﻿/* 手机站基础样式 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif; font-size: 14px; background: #f2f2f7; color: #1c1c1e; }
body { padding-top: 44px; padding-bottom: calc(50px + env(safe-area-inset-bottom)); }
a { text-decoration: none; color: inherit; }
input, button, select, textarea { font-family: inherit; font-size: inherit; }
img { display: block; max-width: 100%; }

/* ===== 顶部导航 ===== */
.m-header {
    position: fixed; top: 0; left: 0; right: 0; height: 44px; z-index: 100;
    background: #2f9900; color: #fff;
    display: flex; align-items: center;
    box-shadow: 0 1px 0 rgba(0,0,0,.15);
}
.m-header-left { width: 60px; display: flex; align-items: center; padding-left: 12px; }
.m-back-btn { font-size: 28px; line-height: 1; color: #fff; padding: 0 4px; }
.m-header-title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; letter-spacing: .5px; }
.m-header-right { max-width: 140px; text-align: right; padding-right: 12px; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.m-money { color: #ffe; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.m-money b { font-size: 13px; color: #ffd700; font-weight: 700; }
.m-money .m-money-unit { font-style: normal; font-size: 11px; color: #ffe; margin-left: 2px; opacity: .85; }
.m-login-link { color: #ffe; border: 1px solid rgba(255,255,255,.6); border-radius: 4px; padding: 3px 8px; font-size: 12px; }

/* ===== 主内容区 ===== */
.m-body { min-height: calc(100vh - 94px); }

/* ===== 底部 TabBar ===== */
.m-tabbar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    height: calc(50px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff; display: flex;
    border-top: 1px solid #e5e5e5;
}
.m-tab-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; color: #8e8e93; padding: 6px 0;
    transition: color .15s;
}
.m-tab-item.active { color: #2f9900; }
.m-tab-icon { font-size: 20px; line-height: 1; }
.m-tab-label { font-size: 10px; margin-top: 2px; }

/* ===== Toast ===== */
.m-toast {
    display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(0,0,0,.75); color: #fff; padding: 10px 20px;
    border-radius: 8px; font-size: 14px; max-width: 70%; text-align: center;
    z-index: 9999; pointer-events: none;
}
.m-toast-ok { background: rgba(39,174,96,.85); }
.m-toast-err { background: rgba(192,57,43,.85); }

/* ===== 通用卡片 ===== */
.m-card { background: #fff; border-radius: 12px; margin: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.m-card-title { font-size: 13px; color: #8e8e93; padding: 12px 16px 6px; font-weight: 500; }

/* ===== 列表单元格 ===== */
.m-cell {
    display: flex; align-items: center; padding: 12px 16px;
    background: #fff; min-height: 48px; position: relative;
}
.m-cell + .m-cell::before {
    content: ''; position: absolute; top: 0; left: 16px; right: 0;
    height: 1px; background: #e5e5e5; transform: scaleY(.5); transform-origin: 0 0;
}
.m-cell-icon { font-size: 20px; margin-right: 12px; width: 28px; text-align: center; }
.m-cell-body { flex: 1; }
.m-cell-title { font-size: 15px; color: #1c1c1e; }
.m-cell-desc { font-size: 12px; color: #8e8e93; margin-top: 2px; }
.m-cell-value { font-size: 14px; color: #8e8e93; margin-right: 6px; }
.m-cell-arrow { color: #c7c7cc; font-size: 18px; }

/* ===== 按钮 ===== */
.m-btn {
    display: block; width: 100%; min-height: 44px; border: none; border-radius: 10px;
    font-size: 16px; font-weight: 600; cursor: pointer; text-align: center;
    line-height: 44px; padding: 0;
}
.m-btn-primary { background: #2f9900; color: #fff; }
.m-btn-primary:active { background: #267a00; }
.m-btn-ghost { background: #fff; color: #2f9900; border: 1px solid #2f9900; }
.m-btn-gray { background: #e5e5ea; color: #3a3a3c; }
.m-btn:disabled { opacity: .5; }

/* ===== 输入框 ===== */
.m-input-wrap { position: relative; }
.m-input {
    display: block; width: 100%; min-height: 44px; padding: 10px 14px;
    border: 1px solid #e5e5e5; border-radius: 10px; background: #fff;
    font-size: 16px; color: #1c1c1e; outline: none;
    -webkit-appearance: none;
}
.m-input:focus { border-color: #2f9900; }
.m-form-group { margin-bottom: 12px; }
.m-form-label { font-size: 13px; color: #8e8e93; margin-bottom: 6px; padding-left: 2px; }

/* ===== 徽章/标签 ===== */
.m-badge { display: inline-block; background: #2f9900; color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 7px; vertical-align: middle; }
.m-badge-gold { background: #f39c12; }
.m-badge-green { background: #27ae60; }

/* ===== 骨架屏 ===== */
.m-skeleton { background: #e5e5ea; border-radius: 6px; animation: skeleton-shine 1.2s ease-in-out infinite; }
@keyframes skeleton-shine {
    0%, 100% { opacity: 1; } 50% { opacity: .4; }
}

/* ===== 加载中 ===== */
.m-loading { text-align: center; padding: 30px; color: #8e8e93; font-size: 14px; }
.m-loading::before { content: ''; display: inline-block; width: 20px; height: 20px; border: 2px solid #e5e5e5; border-top-color: #2f9900; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 空状态 ===== */
.m-empty { text-align: center; padding: 60px 20px; color: #8e8e93; }
.m-empty-icon { font-size: 48px; margin-bottom: 12px; }
.m-empty-text { font-size: 14px; }

/* ===== 首页 Banner ===== */
.m-banner { background: linear-gradient(135deg, #2f9900 0%, #1e5e00 100%); color: #fff; padding: 20px 16px 28px; margin-bottom: -16px; }
.m-banner-user { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.m-banner-avatar { width: 56px; height: 56px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); background: #fff; object-fit: cover; flex-shrink: 0; }
.m-banner-name { font-size: 18px; font-weight: 700; }
.m-banner-money { font-size: 30px; font-weight: 700; color: #ffd700; margin: 4px 0 2px; }
.m-banner-label { font-size: 12px; opacity: .8; }
.m-banner-btns { display: flex; gap: 10px; margin-top: 16px; }
.m-banner-btn { flex: 1; height: 36px; border: 1.5px solid rgba(255,255,255,.7); border-radius: 18px; background: transparent; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }

/* ===== 游戏列表 ===== */
.m-game-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 12px; }
.m-game-item { background: #fff; border-radius: 10px; padding: 14px 8px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.m-game-item:active { opacity: .7; }
.m-game-icon { font-size: 28px; margin-bottom: 6px; }
.m-game-name { font-size: 13px; font-weight: 600; color: #1c1c1e; }
.m-game-sub { font-size: 11px; color: #8e8e93; margin-top: 2px; }
.m-game-tag { display: inline-block; background: #2f9900; color: #fff; font-size: 10px; border-radius: 4px; padding: 1px 5px; margin-top: 4px; }

/* ===== 号码球 ===== */
.m-numbers { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.m-num-ball {
    width: 40px; height: 40px; border-radius: 50%; border: 2px solid #ddd;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; cursor: pointer; background: #fff;
    transition: all .15s; color: #1c1c1e;
}
.m-num-ball.selected { background: #2f9900; border-color: #2f9900; color: #fff; }
.m-num-ball:active { opacity: .7; }

/* ===== 快选金额 ===== */
.m-amount-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 12px; }
.m-amount-chip {
    padding: 6px 14px; border: 1px solid #ddd; border-radius: 16px;
    font-size: 13px; cursor: pointer; background: #fff; color: #1c1c1e;
}
.m-amount-chip.selected { border-color: #2f9900; color: #2f9900; background: #eef9e5; }

/* ===== 排行榜 ===== */
.m-rank-item { display: flex; align-items: center; padding: 10px 16px; border-bottom: 1px solid #f2f2f7; }
.m-rank-no { width: 24px; font-size: 14px; font-weight: 700; color: #8e8e93; text-align: center; margin-right: 10px; }
.m-rank-no.top3 { color: #2f9900; }
.m-rank-name { flex: 1; font-size: 14px; }
.m-rank-val { font-size: 14px; font-weight: 600; color: #2f9900; }

/* ===== 公告跑马灯 ===== */
.m-marquee { background: #fff8e1; border-left: 3px solid #f39c12; padding: 8px 12px; margin: 12px; border-radius: 0 8px 8px 0; font-size: 13px; color: #7d6608; white-space: nowrap; overflow: hidden; }

/* ===== 投注历史 ===== */
.m-history-item { background: #fff; margin: 8px 12px; border-radius: 10px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.m-history-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.m-history-game { font-size: 12px; color: #8e8e93; }
.m-history-status { font-size: 12px; font-weight: 600; }
.m-history-status.win { color: #27ae60; }
.m-history-status.lose { color: #2f9900; }
.m-history-status.wait { color: #f39c12; }
.m-history-nums { font-size: 18px; font-weight: 700; letter-spacing: 3px; color: #1c1c1e; margin: 4px 0; }
.m-history-foot { display: flex; justify-content: space-between; font-size: 12px; color: #8e8e93; }
.m-history-amount { color: #1c1c1e; font-weight: 600; }
.m-history-profit.win { color: #27ae60; font-weight: 700; }

/* ===== 个人中心 ===== */
.m-user-head { background: linear-gradient(135deg, #2f9900 0%, #1e5e00 100%); padding: 24px 16px 32px; color: #fff; }
.m-user-avatar { width: 64px; height: 64px; border-radius: 50%; border: 3px solid rgba(255,255,255,.5); margin-bottom: 10px; background: #fff; }
.m-user-name { font-size: 20px; font-weight: 700; }
.m-user-id { font-size: 13px; opacity: .8; margin-top: 2px; }
.m-user-money-row { display: flex; margin-top: 16px; gap: 24px; }
.m-user-money-item { text-align: center; }
.m-user-money-val { font-size: 20px; font-weight: 700; color: #ffd700; }
.m-user-money-label { font-size: 12px; opacity: .8; margin-top: 2px; }

/* ===== 安全/设置 ===== */
.m-section-title { font-size: 13px; color: #8e8e93; padding: 16px 16px 6px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }

/* ===== 分页加载更多（上滑自动触发） ===== */
.m-load-more { text-align: center; padding: 16px; color: #8e8e93; font-size: 12px; cursor: default; user-select: none; }
.m-load-more::before {
    content: '';
    display: inline-block;
    width: 14px; height: 14px;
    margin-right: 6px;
    border: 2px solid #e5e5ea;
    border-top-color: #2f9900;
    border-radius: 50%;
    vertical-align: middle;
    animation: m-load-spin .7s linear infinite;
}
@keyframes m-load-spin { to { transform: rotate(360deg); } }
.m-no-more { text-align: center; padding: 16px; color: #c7c7cc; font-size: 12px; }
