/* 响应式样式 - Mobile First 方法 */

/* 基础响应式重置 */
* {
    box-sizing: border-box;
}

/* 移动端优先 - 默认样式 (< 768px) */
@media screen and (max-width: 767px) {
    body {
        min-width: 100% !important;
        overflow-x: hidden;
    }
    
    .row12 {
        width: 100% !important;
        padding: 0 15px;
    }
    
    /* 顶部用户栏 */
    .head-user .row12 {
        height: auto;
        padding: 5px 10px;
    }
    
    .head-user .row12 .loginbox {
        font-size: 12px;
        padding-right: 10px;
        display: block;
        text-align: center;
    }
    
    .head-user .loginbox .top_username,
    .head-user .loginbox .top_leftmoney,
    .head-user .loginbox .top_btnplug {
        display: inline-block;
        margin: 5px;
    }
    
    /* 头部 */
    .header {
        height: auto !important;
        padding: 10px 0;
    }
    
    .header .logo {
        width: 200px !important;
        height: 70px !important;
        background-size: contain !important;
        margin: 0 auto;
        float: none !important;
    }
    
    .header .head-menu {
        width: 100% !important;
        padding-top: 10px;
        text-align: center;
    }
    
    .header .head-menu li {
        float: none !important;
        display: inline-block;
        padding: 0 5px;
        background: none !important;
    }
    
    .header .head-menu li a {
        font-size: 14px;
        padding: 0 8px;
    }
    
    /* 顶部新闻栏 */
    #topnews {
        height: auto;
        padding: 5px 10px;
    }
    
    #topnews .topnewswrap {
        width: 100% !important;
        padding: 0 10px;
    }
    
    /* 主内容区 */
    .page-bg1,
    .page-bg2 {
        padding: 10px 0 !important;
    }
    
    /* 游戏中心布局 */
    .game-area,
    .bet-area,
    .result-area {
        width: 100% !important;
        float: none !important;
        margin: 10px 0;
    }
    
    /* 表格响应式 */
    table {
        width: 100% !important;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 按钮调整 */
    button,
    input[type="button"],
    input[type="submit"],
    .btn {
        padding: 8px 15px;
        font-size: 14px;
        min-width: auto;
    }
    
    /* 输入框 */
    input[type="text"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        width: 100%;
        font-size: 14px;
        padding: 8px;
    }
    
    /* 隐藏移动端不需要的元素 */
    .hide-mobile {
        display: none !important;
    }
}

/* 平板端 (768px - 1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    body {
        min-width: 100% !important;
    }
    
    .row12 {
        width: 100% !important;
        max-width: 960px;
        padding: 0 20px;
    }
    
    .header .logo {
        width: 280px;
        height: 100px;
        background-size: contain;
    }
    
    .header .head-menu {
        width: auto;
        padding-top: 35px;
    }
    
    .header .head-menu li {
        padding: 0 10px;
    }
    
    .header .head-menu li a {
        font-size: 15px;
        padding: 0 8px;
    }
    
    /* 隐藏平板端不需要的元素 */
    .hide-tablet {
        display: none !important;
    }
}

/* 小屏幕桌面 (1024px - 1199px) */
@media screen and (min-width: 1024px) and (max-width: 1199px) {
    .row12 {
        width: 100%;
        max-width: 1000px;
        padding: 0 20px;
    }
}

/* 大屏幕 (>= 1200px) - 保持原有样式 */
@media screen and (min-width: 1200px) {
    .row12 {
        width: 1200px;
    }
}

/* 通用响应式优化 */
img {
    max-width: 100%;
    height: auto;
}

/* Flexbox 辅助类 */
.flex-container {
    display: flex;
    flex-wrap: wrap;
}

.flex-item {
    flex: 1 1 auto;
}

/* 响应式显示/隐藏 */
.show-mobile {
    display: none;
}

.show-tablet {
    display: none;
}

.show-desktop {
    display: block;
}

@media screen and (max-width: 767px) {
    .show-mobile {
        display: block !important;
    }
    .hide-mobile {
        display: none !important;
    }
}

@media screen and (min-width: 768px) and (max-width: 1023px) {
    .show-tablet {
        display: block !important;
    }
    .hide-tablet {
        display: none !important;
    }
}

@media screen and (max-width: 1023px) {
    .hide-mobile-tablet {
        display: none !important;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    a, button, input[type="button"], input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
}

/* 横屏优化 */
@media screen and (max-width: 767px) and (orientation: landscape) {
    .header {
        padding: 5px 0;
    }
    
    .header .logo {
        height: 50px !important;
    }
    
    .header .head-menu {
        padding-top: 5px;
    }
}
