/* ===== ao_shell.css — v1/v2/v3 共用外壳（照 capeddo 原站） =====
   桌面：内容宽 1400 居中、6 列、卡片 4:3、供应商胶囊
   手机：固定顶栏(☰/logo/账户) + 黄条分类横滑 + 2 列大卡 + 底部三 tab
   改这一个文件，三个页面同时生效 */

@media (min-width: 961px) {
  /* 原站桌面没有顶部滚动 banner，隐藏以免压住页头 */
  #bannerScroll { display: none !important; }

  /* 桌面卡片统一 4:3，图铺满 */
  .game-card {
    aspect-ratio: 4 / 3 !important;
    height: auto !important;
    position: relative !important;
  }
  .game-card img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
  .game-card .gthumb, .game-card .thumb, .game-card .cover {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }

  .wrap { max-width: 1400px !important; margin: 0 auto !important; }
  .game-grid,
  .gstage .game-grid,
  #gameGrid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 30px !important;
    max-width: 1390px !important;
    margin: 0 auto !important;
  }
  .game-card {
    border-radius: 6px !important;
    overflow: hidden !important;
    background: #2c2f35 !important;
  }
  .game-card img { width: 100% !important; height: 100% !important; object-fit: cover !important; }

  /* 供应商 / 分类胶囊：原站那种 11px 加粗大写小方块 */
  .cat-chip,
  .prov-chip,
  .prov-item {
    background: #2c2f35 !important;
    color: #e9e9e9 !important;
    border: 0 !important;
    border-radius: 5px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: .4px !important;
    padding: 8px 13px !important;
    line-height: 1 !important;
  }
  .cat-chip.active,
  .prov-chip.active,
  .prov-item.active {
    background: #e6a800 !important;
    color: #000 !important;
  }

  /* 搜索框：整行、深底、圆角 */
  #provSearch,
  #gameSearch,
  .ao-search input,
  input[placeholder*="erca"],
  input[placeholder*="搜索"] {
    width: 100% !important;
    background: #2c2f35 !important;
    border: 0 !important;
    border-radius: 6px !important;
    height: 40px !important;
    padding: 0 14px !important;
    color: #e9e9e9 !important;
    font-size: 13px !important;
  }
}

@media (max-width: 960px) {
  html {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    padding-top: 100px !important;
    padding-bottom: 74px !important;
  }
  /* 手机端隐藏与黄条重复的旧导航 / 旧 logo 行 */
  .main-nav, .nav-card, #aoFilterRow > .nav-card { display: none !important; }
  .cat-bar { margin-top: 0 !important; }

  /* 固定顶栏 */
  .ao-m-top {
    position: fixed; top: 0; left: 0; right: 0; height: 56px;
    display: flex; align-items: center; gap: 6px; padding: 0 10px;
    background: #23262b; z-index: 2100;
    box-shadow: 0 2px 10px rgba(0,0,0,.45);
  }
  .ao-m-burger {
    width: 38px; height: 38px; flex: 0 0 38px;
    background: transparent; border: 0; color: #fff;
    font-size: 21px; line-height: 1; cursor: pointer;
  }
  .ao-m-logo { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-width: 0; }
  .ao-m-logo img { height: 26px; width: auto; max-width: 62vw; object-fit: contain; }
  .ao-m-user {
    width: 38px; height: 38px; flex: 0 0 38px;
    background: transparent; border: 0; color: #fff;
    font-size: 17px; cursor: pointer;
  }

  /* 黄条分类（横滑） */
  .ao-m-nav {
    position: fixed; top: 56px; left: 0; right: 0; height: 44px;
    display: flex; align-items: center; gap: 20px; padding: 0 14px;
    background: #e6a800; overflow-x: auto; z-index: 2099;
    -webkit-overflow-scrolling: touch;
  }
  .ao-m-nav::-webkit-scrollbar { display: none; }
  .ao-m-nav button {
    flex: 0 0 auto; background: transparent; border: 0; color: #000;
    font-size: 13px; font-weight: 800; letter-spacing: .6px;
    text-transform: uppercase; white-space: nowrap; padding: 0; cursor: pointer;
  }
  .ao-m-nav button.on { text-decoration: underline; text-underline-offset: 6px; }

  #bannerScroll { height: 132px !important; }
  #bannerScroll img { height: 132px !important; object-fit: cover !important; }

  /* 底部三 tab */
  .ao-m-tabs {
    position: fixed; left: 0; right: 0; bottom: 0; height: 66px;
    display: flex; align-items: stretch;
    background: #22262b; border-top: 1px solid #31353b; z-index: 2100;
  }
  .ao-m-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; background: transparent; border: 0; color: #c2c7cd;
    font-size: 11px; font-weight: 700; letter-spacing: .8px; cursor: pointer;
  }
  .ao-m-tab i { font-size: 18px; line-height: 1; }
  .ao-m-tab.on { color: #e6a800; }

  /* 抽屉 */
  .ao-m-drawer {
    position: fixed; top: 0; bottom: 0; left: 0; width: min(78vw, 300px);
    background: #1d2024; z-index: 2200; overflow-y: auto;
    transform: translateX(-103%); transition: transform .22s ease;
    padding: 14px 0 90px;
  }
  .ao-m-drawer.open { transform: translateX(0); }
  .ao-m-drawer h6 { margin: 10px 16px 8px; color: #7d838c; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
  .ao-m-drawer button, .ao-m-drawer a {
    display: block; width: 100%; text-align: left; padding: 13px 18px;
    background: transparent; border: 0; border-bottom: 1px solid #262a30;
    color: #e9e9e9; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
  }
  .ao-m-mask {
    position: fixed; inset: 0; z-index: 2150; background: rgba(0,0,0,.55); display: none;
  }
  .ao-m-mask.on { display: block; }

  /* 隐藏旧头部（JS 打标） */
  .ao-hide-m { display: none !important; }

  /* 网格：2 列大卡，圆角 10 */
  .game-grid,
  .gstage .game-grid,
  #gameGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 15px !important;
    padding: 15px !important;
    margin: 0 !important;
  }
  .game-card {
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #2c2f35 !important;
    aspect-ratio: 4 / 3 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    position: relative !important;
  }
  .game-card img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
  }
  .game-card .gthumb, .game-card .thumb, .game-card .cover {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
  }
  .game-card .gname, .game-card .game-name {
    display: none !important;
  }

  .nav-card { flex: 0 0 92px !important; }
  .ao-rows-wrap { width: auto !important; max-width: none !important; margin: 12px 0 16px !important; }
  #aoFloat { display: none !important; }
}

/* 笔记本档（960–1279）：4 列居中，避免 6 列在 1024/1280 被压扁 */
@media (min-width: 961px) and (max-width: 1279px) {
  .game-grid,
  .gstage .game-grid,
  #gameGrid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px !important;
    max-width: 1180px !important;
    margin: 0 auto !important;
    padding: 0 24px !important;
  }
}
