/* 全站手机端适配（2026-10-01）
 * 在 style.min.css / theme-light.css 之后加载，只在 ≤640px 生效，桌面布局不受影响。
 * 原则：单列、字号收一档、表格横向可滚、按钮够大能戳、输入框 ≥16px 防 iOS 放大。 */
@media (max-width: 640px) {
  html { -webkit-text-size-adjust: 100%; }
  .container { padding-left: 12px; padding-right: 12px; }
  img, video, canvas, svg { max-width: 100%; }
  input, select, textarea { font-size: 16px !important; }
  .btn, .btn-primary, button.btn { min-height: 44px; }

  /* 顶部公告条 */
  .announcement-bar, .announcement { font-size: 13px; }

  /* 首页：游戏卡片单列，跨两列的卡片收回来 */
  .games-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .games-grid .game-card { grid-column: span 1 !important; padding: 16px; }
  .hero h1, .hero-title { font-size: 30px !important; }

  /* 仪表盘：欢迎卡里的大数字和标题 */
  .dashboard h1 { font-size: 24px !important; line-height: 1.25; }
  .dashboard .module-card [style*="font-size: 32px"] { font-size: 22px !important; }
  .dashboard .module-card [style*="font-size: 28px"] { font-size: 20px !important; }
  .dashboard .module-card [style*="font-size: 24px"] { font-size: 18px !important; }
  .module-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .module-card { padding: 16px; }
  .module-card h3 { font-size: 16px; }
  .module-icon { font-size: 28px; }

  /* 表格：排行榜 / 管理后台 / 战绩，整表横向滚动而不是把列挤成一个字一行 */
  .ranking-table, .data-table, table.leaderboard, .admin-table {
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; max-width: 100%;
  }
  .ranking-table th, .ranking-table td, .data-table th, .data-table td { padding: 8px 10px; font-size: 13px; }

  /* 页面大标题普遍过大 */
  h1 { font-size: 26px; }
  h2 { font-size: 20px; }

  /* 棋类大厅：投注档位 / 房间号 一行放不下就换行 */
  .bet-selector, .bet-options, .stake-row { flex-wrap: wrap; gap: 8px; }

  /* 聊天：侧栏与消息区上下排 */
  .chat-layout, .chat-container { grid-template-columns: 1fr !important; flex-direction: column; }
  .chat-sidebar { max-height: 38vh; }

  /* 个人主页 / 设置 */
  .profile-header { flex-direction: column; text-align: center; }
  .settings-card { padding: 16px; }

  /* 页脚 */
  footer, .footer { font-size: 12px; padding: 16px 12px; }
}

@media (max-width: 380px) {
  .dashboard .module-card [style*="font-size: 32px"] { font-size: 19px !important; }
  h1 { font-size: 22px; }
}
