/* ============================================================
 * console-m.css — 仅 console.html 引用
 * 移动端游戏机页（≤767px）：m-* 专用结构，桌面零改动
 * 依赖：console.css（桌面布局）
 * ============================================================ */

.m-top, .m-hero, .m-chips, .m-sec--console, .m-more, .m-cta, .m-footer, .m-tabbar, .m-drawer { display: none; }

@media (max-width: 767px) {
  /* 隐藏桌面结构（本文件仅游戏机页加载） */
  .ag-header,
  .ag-main,
  .game-footer { display: none !important; }

  body.ag-page { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }

  .m-top { display: block; }
  .m-hero, .m-chips, .m-sec--console, .m-more, .m-cta { display: block; }
  .m-tabbar { display: flex; }

  /* ---------- 顶栏 ---------- */
  .m-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 8px;
  }
  .m-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
  .m-logo img { height: 40px; }
  .m-logo-text { display: flex; flex-direction: column; line-height: 1.15; }
  .m-logo-text b {
    font-size: 19px; color: #ffcc00; letter-spacing: 2px; font-weight: 800;
    text-shadow: 0 0 14px rgba(255, 204, 0, .45);
  }
  .m-logo-text i { font-style: normal; font-size: 9.5px; color: #9a93a8; letter-spacing: 2.5px; }
  .m-topbar-actions { display: flex; gap: 8px; }
  .m-ico-btn {
    width: 40px; height: 40px; border-radius: 11px;
    background: #17171f; border: 1px solid #2b2b36; color: #e8e8f0;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
  }
  .m-ico-btn--gold {
    background: linear-gradient(160deg, #ffd54a, #ffaa00);
    border-color: transparent; color: #1a1206;
    box-shadow: 0 2px 10px rgba(255, 170, 0, .35);
  }

  /* ---------- 搜索框 ---------- */
  .m-search {
    display: flex; align-items: center; gap: 8px;
    margin: 2px 14px 10px; padding: 0 12px;
    height: 38px; border-radius: 11px;
    background: #14141b; border: 1px solid #2b2b36; color: #8a8a96;
  }
  .m-search input {
    flex: 1; min-width: 0; background: transparent; border: 0; outline: none;
    color: #f0f0f5; font-size: 14px;
  }
  .m-search input::placeholder { color: #6b6b78; }
  .m-search button {
    background: transparent; border: 0; color: #ffcc00;
    font-size: 14px; font-weight: 700; cursor: pointer; padding: 4px 2px;
  }

  /* ---------- 分类导航条 ---------- */
  .m-catnav {
    display: flex; align-items: stretch;
    padding: 6px 10px 10px; gap: 4px;
    border-bottom: 1px solid #1d1d26;
  }
  .m-catnav a {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 7px 0; border-radius: 11px; text-decoration: none;
    color: #c9c9d4; font-size: clamp(10.5px, 3.1vw, 12px); font-weight: 600;
  }
  .m-catnav a span { white-space: nowrap; }
  .m-catnav a svg { width: 21px; height: 21px; }
  .m-catnav a.active {
    background: linear-gradient(160deg, #ffd54a, #ffaa00);
    color: #1a1206; font-weight: 800;
    box-shadow: 0 2px 10px rgba(255, 170, 0, .3);
  }

  /* ---------- 抽屉菜单 ---------- */
  .m-drawer {
    display: none;
    position: fixed; z-index: 90;
    top: 64px; right: 14px; min-width: 148px;
    background: #17171f; border: 1px solid #2b2b36; border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .6);
    overflow: hidden;
  }
  .m-drawer.open { display: block; }
  .m-drawer a {
    display: block; padding: 11px 18px; color: #d8d8e2;
    font-size: 14px; text-decoration: none; border-bottom: 1px solid #22222c;
  }
  .m-drawer a:last-child { border-bottom: 0; }
  .m-drawer a:active { background: #20202b; color: #ffcc00; }

  /* ---------- Banner（经典游戏机） ---------- */
  .m-hero--console {
    display: block;
    margin: 12px 12px 0;
    aspect-ratio: 802 / 192;
    border-radius: 14px; overflow: hidden;
    border: 1px solid rgba(150, 90, 255, .25);
    background: url('../images/common/console-hero.jpg') center / 100% 100% no-repeat, #0a0a0f;
  }

  /* ---------- 平台筛选芯片 ---------- */
  .m-chips {
    display: flex; gap: 8px;
    margin: 12px 12px 0;
    overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none;
  }
  .m-chips::-webkit-scrollbar { display: none; }
  .m-chip {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 15px; border-radius: 10px;
    background: #14141b; border: 1px solid #2b2b36;
    color: #c9c9d4; font-size: 13.5px; font-weight: 600;
    cursor: pointer; white-space: nowrap;
  }
  .m-chip svg { width: 16px; height: 16px; }
  .m-chip.active {
    background: linear-gradient(160deg, #ffd54a, #ffaa00);
    border-color: transparent; color: #1a1206; font-weight: 800;
    box-shadow: 0 2px 10px rgba(255, 170, 0, .3);
  }

  /* ---------- 主机大卡（2 列） ---------- */
  .m-sec--console { margin: 13px 12px 0; }
  .m-console-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  }
  .m-console {
    position: relative;
    display: flex; flex-direction: column; align-items: center;
    padding: 14px 11px 12px;
    border-radius: 14px; text-decoration: none;
    background: linear-gradient(155deg, #191324, #101016);
    border: 1px solid #34284a;
    box-shadow: 0 4px 18px rgba(80, 40, 160, .12);
  }
  .m-console-badge {
    position: absolute; top: 8px; right: 8px;
    padding: 2px 8px; border-radius: 7px;
    background: linear-gradient(160deg, #ff5a5a, #e02f2f);
    color: #fff; font-size: 10px; font-weight: 700;
    box-shadow: 0 2px 8px rgba(224, 47, 47, .4);
  }
  .m-console-img {
    width: 100%; height: 86px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 9px;
  }
  .m-console-img img {
    max-width: 100%; max-height: 100%; object-fit: contain; display: block;
  }
  .m-console-name {
    align-self: flex-start;
    color: #f2f2f5; font-size: 15px; font-weight: 800;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  }
  .m-console-sub {
    align-self: flex-start;
    margin-top: 3px; color: #8a8a96; font-size: 11px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  }
  .m-console-count {
    align-self: flex-start;
    display: flex; align-items: center; gap: 5px;
    margin-top: 7px; color: #c9c9d4; font-size: 12px; font-weight: 600;
  }
  .m-console-count svg { width: 14px; height: 14px; color: #ffcc00; }
  .m-console .m-play-btn {
    align-self: stretch;
    margin-top: 10px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    background: linear-gradient(160deg, #ffd54a, #ffaa00);
    color: #1a1206; font-size: 13.5px; font-weight: 800; text-decoration: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(255, 170, 0, .3);
  }
  .m-console .m-play-btn::after { content: '▶'; font-size: .8em; }

  /* ---------- 更多游戏机 ---------- */
  .m-more { margin: 20px 12px 0; }
  .m-more-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
  }
  .m-more-head h2 {
    margin: 0; display: flex; align-items: center; gap: 7px;
    color: #f2f2f5; font-size: 16.5px; font-weight: 800;
  }
  .m-more-head h2 .star { color: #ffcc00; font-size: 15px; text-shadow: 0 0 10px rgba(255, 204, 0, .5); }
  .m-more-head a { color: #9a9aa6; font-size: 12.5px; text-decoration: none; }
  .m-more-row {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; margin-bottom: 9px;
    border-radius: 12px; text-decoration: none;
    background: linear-gradient(150deg, #15151d, #101016);
    border: 1px solid #23232d;
  }
  .m-more-thumb {
    width: 74px; height: 52px; flex: 0 0 74px;
    display: flex; align-items: center; justify-content: center;
  }
  .m-more-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
  .m-more-info { flex: 1; min-width: 0; }
  .m-more-name {
    display: block; color: #f2f2f5; font-size: 14.5px; font-weight: 800;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .m-more-sub {
    display: block; margin-top: 3px; color: #8a8a96; font-size: 11.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .m-more-row .m-play-btn {
    flex: 0 0 auto; height: 31px; padding: 0 12px;
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    background: linear-gradient(160deg, #ffd54a, #ffaa00);
    color: #1a1206; font-size: 12px; font-weight: 800; text-decoration: none;
    border-radius: 9px;
    box-shadow: 0 2px 10px rgba(255, 170, 0, .3);
  }
  .m-more-row .m-play-btn::after { content: '▶'; font-size: .78em; }

  /* ---------- 底部 CTA 横幅 ---------- */
  .m-cta {
    display: block;
    margin: 16px 12px 0;
    aspect-ratio: 802 / 56;
    border-radius: 12px; overflow: hidden;
    border: 1px solid rgba(150, 90, 255, .3);
    background: url('../images/common/console-cta.jpg') center / 100% 100% no-repeat, #0a0a0f;
  }

  /* ---------- 简化页脚 ---------- */
  .m-footer {
    display: block;
    margin-top: 22px; padding: 16px 14px 18px;
    border-top: 1px solid #1d1d26; text-align: center;
  }
  .m-footer p { margin: 0 0 6px; }
  .m-footer-copy { color: #7d7d8a; font-size: 11.5px; }
  .m-footer-links { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 !important; }
  .m-footer-links a { color: #9a9aa6; font-size: 11.5px; text-decoration: none; }
  .m-footer-links span { color: #33333e; }

  /* ---------- 底部 TabBar（首页/分类/排行/主机/我的） ---------- */
  .m-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(14, 14, 20, .96);
    border-top: 1px solid #23232d;
    backdrop-filter: blur(10px);
  }
  .m-tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: #8a8a96; font-size: 11px; text-decoration: none;
  }
  .m-tabbar a svg { width: 22px; height: 22px; }
  .m-tabbar a.active { color: #ffcc00; font-weight: 700; }
}
