/* =========================================================
   登录态显示控制
   - 未登录：只显示 滚球盘 + 登录/注册
   - 已登录：显示全部功能
   ========================================================= */

/* 默认（未登录）：带 data-auth 的元素全部隐藏 */
body:not(.is-auth) [data-auth] { display: none !important; }

/* 未登录时，登录/注册入口可见 */
body.is-auth .guest-only { display: none !important; }

/* 已登录时顶栏账户区更紧凑 */
body.is-auth .acct .bal { font-weight: 600; }

/* 未登录时投注单浮标隐藏（不能下注） */
body:not(.is-auth) .slip-fab { display: none !important; }
body:not(.is-auth) .slip { display: none !important; }
body:not(.is-auth) .slip-layout { grid-template-columns: 1fr !important; }

/* 未登录时赛事列表下方的下注按钮弱化，点击后提示登录 */
body:not(.is-auth) .obtn { cursor: pointer; }

/* =========================================================
   禁止右键审查 / 文本选择
   ========================================================= */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* 输入框和只读数据区保留可选中，否则没法复制订单号 */
input, textarea, select, .mono, .tbl td, .tbl th {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* 移动端禁止长按弹出菜单 */
body { -webkit-tap-highlight-color: transparent; }

/* =========================================================
   PC 端优化（>= 1024px）
   ========================================================= */
@media (min-width: 1024px) {
  /* 顶栏更稳，减少视觉抖动 */
  .topbar .wrap { min-height: 52px; }

  /* 主内容区左右留白更舒适 */
  .wrap { max-width: 1240px; }

  /* 赛事列表与投注单比例更合理 */
  .slip-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }

  /* 表格行高加大，方便扫读 */
  .tbl td, .tbl th { padding: 8px 10px; }

  /* 悬浮态只给可交互元素 */
  .mainnav a { transition: color .1s, background .1s, border-color .1s; }

  /* 数据密集区用等宽数字，列对齐不跳 */
  .mono, .bal, .tbl td.num { font-variant-numeric: tabular-nums; }
}

/* =========================================================
   移动端 / H5 优化（<= 767px）
   ========================================================= */
@media (max-width: 767px) {
  /* 顶栏精简：只留品牌和账户按钮 */
  .topbar .wrap { min-height: 46px; }
  .mainnav { display: none; }

  /* 底部导航：给安全区留白，不吃 Home 指示条 */
  .tabbar {
    height: calc(50px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex;
    align-items: stretch;
  }
  .tabbar a {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    line-height: 1.2;
    padding: 4px 0;
  }
  .tabbar a .ic { font-size: 16px; line-height: 1; }

  /* 主内容避开底部导航 */
  .main { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }

  /* 输入框 16px 防 iOS 自动放大 */
  input, textarea, select { font-size: 16px !important; }

  /* 按钮触控区不小于 30px */
  .btn, .obtn, .tabs button { min-height: 30px; }

  /* 投注单浮标避开底部导航 */
  .slip-fab { bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }

  /* 表格横向滚动不撑破布局 */
  .tbl { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* 卡片间距收紧，一屏多看几场 */
  .matchlist .match { margin-bottom: 6px; }

  /* 未登录时底栏只有两格，居中更稳 */
  body:not(.is-auth) .tabbar a { flex: 1 1 0; }
}

/* 超窄屏（<= 360px） */
@media (max-width: 360px) {
  .tabbar a { font-size: 10px; }
  .tabbar a .ic { font-size: 15px; }
}

/* =========================================================
   未登录引导条
   ========================================================= */
.guest-hint {
  display: none;
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  background: var(--bg2);
  color: var(--tx2);
  font-size: 13px;
  line-height: 1.6;
}
body:not(.is-auth) .guest-hint { display: block; }
.guest-hint b { color: var(--gold); font-weight: 600; }
.guest-hint .acts { margin-top: 8px; display: flex; gap: 8px; }
