/* ==========================================================================
   MGM · 独立大厅 · 布局样式
   --------------------------------------------------------------------------
   只使用 tokens.css 的变量；类名 .mh-* 为稳定契约（美术可覆写，勿改名）。
   ========================================================================== */

.mh-app {
  position: relative;
  max-width: var(--mh-max-width);
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--mh-nav-h) + env(safe-area-inset-bottom, 0px));
  background: var(--mh-bg, #0d0d12) var(--mh-bg-glow) no-repeat;
  background-image: var(--mh-bg-image), var(--mh-bg-glow);
  background-size: cover, auto;
  background-position: center top, 0 0;
  color: var(--mh-text);
  font-family: var(--mh-font);
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 顶栏 ---------- */
.mh-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--mh-space-3);
  height: var(--mh-header-h);
  padding: 0 var(--mh-space-4);
  background: linear-gradient(180deg, rgba(13, 13, 18, .96), rgba(13, 13, 18, .72));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--mh-border);
}
.mh-logo {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--mh-logo-image) center/contain no-repeat, var(--mh-surface-2);
  border: 1px solid var(--mh-border-strong);
  flex: none;
}
.mh-brand { flex: 1; min-width: 0; }
.mh-brand b { display: block; font-size: var(--mh-fs-lg); letter-spacing: 2px; }
.mh-brand small { display: block; font-size: var(--mh-fs-xs); color: var(--mh-text-dim); letter-spacing: 1px; }
.mh-balance {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--mh-radius-pill);
  background: rgba(10, 10, 15, .8);
  border: 1px solid var(--mh-border-strong);
  color: var(--mh-gold); font-size: var(--mh-fs-sm); font-weight: 800;
  cursor: pointer; flex: none;
}
.mh-balance:active { transform: scale(.97); }
.mh-icon-btn {
  width: 34px; height: 34px; border-radius: var(--mh-radius-sm);
  background: var(--mh-surface); border: 1px solid var(--mh-border);
  color: var(--mh-text); font-size: 15px; cursor: pointer; flex: none;
}

/* ---------- 横幅 ---------- */
.mh-banner {
  margin: var(--mh-space-3) var(--mh-space-4) 0;
  border-radius: var(--mh-radius);
  overflow: hidden;
  aspect-ratio: var(--mh-banner-ratio);
  background: var(--mh-surface-2) center/cover no-repeat;
  border: 1px solid var(--mh-border);
  box-shadow: var(--mh-shadow-1);
  position: relative;
}
.mh-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mh-banner-dots { position: absolute; right: 10px; bottom: 8px; display: flex; gap: 4px; }
.mh-banner-dots i {
  width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .45);
}
.mh-banner-dots i.on { background: var(--mh-gold); width: 14px; border-radius: 3px; }

/* ---------- 分类横滑 ---------- */
.mh-cats {
  display: flex; gap: var(--mh-space-2);
  overflow-x: auto; scrollbar-width: none;
  padding: var(--mh-space-3) var(--mh-space-4) var(--mh-space-1);
}
.mh-cats::-webkit-scrollbar { display: none; }
.mh-cat {
  flex: none; padding: 7px 16px; border-radius: var(--mh-radius-pill);
  background: var(--mh-surface); border: 1px solid var(--mh-border);
  color: var(--mh-text-dim); font-size: var(--mh-fs-sm); cursor: pointer;
  white-space: nowrap;
}
.mh-cat.on {
  background: linear-gradient(180deg, var(--mh-accent), #124a86);
  border-color: var(--mh-accent-2);
  color: #fff; font-weight: 800;
}

/* ---------- 分区 ---------- */
.mh-section { margin: var(--mh-space-4) var(--mh-space-4) 0; }
.mh-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: var(--mh-space-3);
}
.mh-section-head b { font-size: var(--mh-fs-lg); letter-spacing: 1px; }
.mh-section-head small { color: var(--mh-text-dim); font-size: var(--mh-fs-xs); }
.mh-section-head a { color: var(--mh-gold); font-size: var(--mh-fs-sm); cursor: pointer; text-decoration: none; }

/* ---------- 通用卡片网格 ---------- */
.mh-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--mh-space-3); }
.mh-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.mh-card {
  position: relative; overflow: hidden; text-align: left;
  border-radius: var(--mh-radius); padding: var(--mh-space-3);
  background: linear-gradient(160deg, var(--mh-surface-2), var(--mh-surface));
  border: 1px solid var(--mh-border);
  box-shadow: var(--mh-inset-hi), var(--mh-shadow-1);
  color: var(--mh-text); cursor: pointer;
  transition: transform .14s ease;
}
.mh-card:active { transform: scale(.97); }
.mh-card-ico { font-size: 26px; line-height: 1; }
.mh-card-nm { margin-top: 8px; font-size: var(--mh-fs); font-weight: 800; letter-spacing: .5px; }
.mh-card-ds { margin-top: 4px; font-size: var(--mh-fs-xs); color: var(--mh-text-dim); line-height: 1.5; min-height: 30px; }
.mh-card-go {
  display: inline-block; margin-top: 8px; padding: 5px 12px;
  border-radius: var(--mh-radius-pill);
  background: var(--mh-gold-grad); color: #2a1a00;
  font-size: var(--mh-fs-xs); font-weight: 800;
}
.mh-card-tag {
  position: absolute; right: 10px; top: 10px;
  padding: 2px 8px; border-radius: var(--mh-radius-pill);
  background: rgba(254, 183, 0, .16); border: 1px solid rgba(254, 183, 0, .5);
  color: var(--mh-gold); font-size: 10px;
}

/* ---------- 彩票卡片（横排大卡）---------- */
.mh-lottery-grid { display: grid; gap: var(--mh-space-2); }
.mh-lottery-card {
  display: flex; align-items: center; gap: var(--mh-space-3);
  padding: var(--mh-space-3);
  border-radius: var(--mh-radius);
  background: linear-gradient(160deg, var(--mh-surface-2), var(--mh-surface));
  border: 1px solid var(--mh-border);
  box-shadow: var(--mh-inset-hi), var(--mh-shadow-1);
  cursor: pointer;
}
.mh-lottery-card:active { transform: scale(.99); }
.mh-lottery-ico { font-size: 24px; flex: none; }
.mh-lottery-body { flex: 1; min-width: 0; }
.mh-lottery-body b { display: block; font-size: var(--mh-fs); }
.mh-lottery-nums { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.mh-lottery-nums i {
  min-width: 22px; height: 22px; padding: 0 4px; border-radius: 6px;
  background: var(--mh-surface-3); border: 1px solid var(--mh-border);
  color: var(--mh-gold); font-size: 11px; font-style: normal;
  display: inline-flex; align-items: center; justify-content: center;
}
.mh-lottery-go { color: var(--mh-gold); font-size: var(--mh-fs-sm); font-weight: 800; flex: none; }

/* ---------- 厂商游戏（小卡）---------- */
.mh-games { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--mh-space-2); }
.mh-game {
  border-radius: var(--mh-radius-sm); overflow: hidden; cursor: pointer;
  background: var(--mh-surface-2); border: 1px solid var(--mh-border);
  aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  color: var(--mh-text); padding: 6px;
}
.mh-game:active { transform: scale(.96); }
.mh-game-ico { font-size: 22px; line-height: 1; }
.mh-game-nm {
  font-size: 10.5px; color: var(--mh-text-dim); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.mh-game img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 底部导航 ---------- */
.mh-nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: var(--mh-max-width);
  height: calc(var(--mh-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; z-index: 30;
  background: linear-gradient(180deg, rgba(13, 13, 18, .96), rgba(8, 8, 12, .99));
  border-top: 1px solid var(--mh-border);
  backdrop-filter: blur(10px);
}
.mh-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; background: none; border: 0; cursor: pointer;
  color: var(--mh-text-faint); font-size: 10.5px;
}
.mh-nav-item .i { font-size: 19px; line-height: 1; }
.mh-nav-item.on { color: var(--mh-gold); font-weight: 800; }

/* ---------- 状态 / 骨架 / toast ---------- */
.mh-skel {
  border-radius: var(--mh-radius); background: linear-gradient(90deg, var(--mh-surface), var(--mh-surface-2), var(--mh-surface));
  background-size: 200% 100%; animation: mh-shimmer 1.2s linear infinite;
}
@keyframes mh-shimmer { to { background-position: -200% 0; } }
.mh-empty { padding: 28px 0; text-align: center; color: var(--mh-text-faint); font-size: var(--mh-fs-sm); }
.mh-toast {
  position: fixed; left: 50%; bottom: calc(var(--mh-nav-h) + 24px);
  transform: translateX(-50%);
  padding: 9px 18px; border-radius: var(--mh-radius-pill);
  background: rgba(10, 10, 15, .94); border: 1px solid var(--mh-border-strong);
  color: var(--mh-text); font-size: var(--mh-fs-sm); z-index: 60;
  max-width: 80%; text-align: center;
}
.mh-footer {
  padding: 22px var(--mh-space-4) 10px; text-align: center;
  color: var(--mh-text-faint); font-size: 10.5px; line-height: 1.7;
}
