/* ========================================
   全局重置与变量
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 - 与原版一致 */
    --primary-color: #046bd2;
    --primary-dark: #045cb4;
    --accent-color: #ff5400;
    --bg-dark: #1a1a2e;
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    --text-light: #ffffff;
    --text-dark: #334155;
    --border-color: #e2e8f0;
    
    /* 断点 */
    --breakpoint-mobile: 921px;
}

html {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-light);
    min-height: 100vh;
    padding-top: 70px;    /* 为顶部导航留空间 */
    padding-bottom: 70px; /* 为底部导航留空间 */
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

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

img {
    max-width: 100%;
    height: auto;
}

/* ========================================
   置顶导航栏 (Sticky Header)
   ======================================== */
.navbar {
    position: fixed;            /* 固定定位 - 始终显示在顶部 */
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100vw;
    z-index: 1000;              /* 确保在最上层 */
    background: var(--bg-gradient);
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

/* ========================================
   主内容区域
   ======================================== */
.main-content {
    padding: 20px;  /* 移除内边距，让内容贴边 */
}

.container {
    max-width: 100%;  /* 改为100%，铺满整个屏幕 */
    margin: 0;
    padding: 0;  /* 左右留一点间距避免完全贴边 */
}

/* Hero 区域：三栏布局（左-中-右 各33%） */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;  /* 三栏等分 */
    gap: 20px;
}

/* ========================================
   左侧栏样式
   ======================================== */
.hero-left {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ========================================
   中间栏样式（游戏标签页）
   ======================================== */
.hero-center {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
}

/* ========================================
   右侧栏样式（Payment + 轮播 + 交易）
   ======================================== */
.hero-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 图片轮播 */
.carousel {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

.carousel-inner {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;  /* 匹配 banner 图片实际比例 */
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.carousel-slide.active {
    opacity: 1;
}

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

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

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

.dot.active {
    background: var(--accent-color);
}

/* Welcome Bonus 卡片 */
.bonus-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.bonus-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px 10px;
    text-align: center;
}

.bonus-card img {
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
}

.bonus-card h3 {
    font-size: 12px;
    margin-bottom: 4px;
    color: var(--text-light);
}

.bonus-card p {
    font-size: 14px;
    font-weight: bold;
    color: var(--accent-color);
}

/* 操作按钮 */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn {
    display: inline-block;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-copy {
    background: var(--accent-color);
    color: var(--text-light);
}

.btn-share {
    background: var(--primary-color);
    color: var(--text-light);
}

.btn-login {
    background: #28a745;
    color: var(--text-light);
}

.btn-register {
    background: #dc3545;
    color: var(--text-light);
}

.btn:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

/* ========================================
   游戏标签页控件
   ======================================== */
.tab-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: stretch;  /* 填满整行 */
}

.tab-btn {
    flex: 1;  /* 平均分配宽度，填满容器 */
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    padding: 15px 20px;  /* 增大内边距 */
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-btn img {
    width: 100px;   /* 图片放大 */
    max-width: none;  /* 覆盖全局 max-width: 100% 限制 */
    height: auto;   /* 高度自适应，保持原始比例 */
    object-fit: contain;  /* 确保图片不变形 */
}

.tab-btn.active,
.tab-btn:hover {
    background: var(--primary-color);
}

.tab-content {
    position: relative;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

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

.game-grid a {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
}

.game-grid a:hover {
    transform: scale(1.05);
}

.game-grid img {
    width: 100%;
    height: auto;
    display: block;
}

.placeholder {
    text-align: center;
    padding: 50px;
    color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   Payment Methods 支付方式
   ======================================== */
.payment-section {
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
}

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

.payment-header h5 {
    font-size: 14px;
    color: var(--text-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.payment-header img {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    height: auto;
    max-height: 40px;
    object-fit: contain;
    object-position: left center;
}

/* ========================================
   右侧轮播图（第二个）- 正方形样式
   ======================================== */
.carousel-secondary {
    margin-top: 15px;
    width: 100%;            /* 全宽，与其他元素对齐 */
    background: rgba(0, 0, 0, 0.3);  /* 背景色 */
}

.carousel-secondary .carousel-inner {
    width: 100%;
    padding-bottom: 80%;   /* 匹配 promo 图片实际比例 5:4 */
    position: relative;
}

.carousel-secondary .carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

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

/* ========================================
   Live Transaction 实时交易表格
   ======================================== */
.live-transaction {
    margin-top: 15px;
    border-radius: 10px;
    overflow: hidden;
}

.transaction-table {
    width: 100%;
    border-collapse: collapse;
    color: #ffffff;
    font-size: 12px;
}

.transaction-table th {
    background-color: #140F0A;
    padding: 8px 5px;
    text-align: center;
}

.transaction-table .live-badge {
    color: #E74C3C;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.transaction-table td {
    padding: 6px 5px;
    text-align: center;
    background-color: #996515;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

.transaction-table tr:nth-child(even) td {
    background-color: #7a5012;
}

.transaction-table .hidden {
    display: none;
}

/* ========================================
   底部固定导航栏
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100vw;
    z-index: 1000;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
    font-size: 12px;
    gap: 4px;
    transition: color 0.3s;
}

.nav-item i {
    font-size: 20px;
}

.nav-item:hover {
    color: var(--accent-color);
}

/* ========================================
   响应式设计 (移动端 ≤921px)
   ======================================== */
@media (max-width: 921px) {
    /* 三栏变为单栏堆叠 */
    .hero-grid {
        grid-template-columns: 1fr;
    }

    /* 中间栏背景样式 */
    .hero-center {
        order: 2; /* 调整顺序：左栏 -> 中间栏 -> 右栏 */
    }

    .hero-right {
        order: 3;
    }

    /* 游戏网格变为3列 */
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Bonus卡片保持3列但缩小 */
    .bonus-card h3 {
        font-size: 10px;
    }

    .bonus-card p {
        font-size: 12px;
    }

    .bonus-card img {
        width: 40px;
        height: 40px;
    }

    /* 平板端 Tab 图片 */
    .tab-btn img {
        width: 80px;
        max-width: 100%;
        height: auto;
    }

    /* 移动端容器限制 */
    .main-content {
        padding: 10px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .container {
        max-width: 100%;
        overflow: hidden;
    }

    .hero-section {
        max-width: 100%;
        overflow: hidden;
    }
}

@media (max-width: 544px) {
    /* 主内容区域适配 */
    .main-content {
        padding: 8px;
    }

    /* Bonus卡片保持3列 */
    .bonus-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }

    .bonus-card {
        padding: 8px 4px;
    }

    .bonus-card img {
        width: 28px;
        height: 28px;
    }

    .bonus-card h3 {
        font-size: 8px;
    }

    .bonus-card p {
        font-size: 9px;
    }

    /* 游戏网格变为2列 */
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 按钮变小 */
    .btn {
        padding: 10px 12px;
        font-size: 11px;
    }

    /* 手机端 Tab 图片 - 限制最大宽度 */
    .tab-btn {
        padding: 8px 4px;
    }

    .tab-btn img {
        width: 50px;
        max-width: 100%;
        height: auto;
    }

    /* 游戏标签按钮缩小间距 */
    .tab-controls {
        gap: 5px;
    }

    /* 操作按钮适配 */
    .action-buttons {
        gap: 6px;
    }
}

