/* =====================================================================
   mroomy.css —— 手机端历史抽屉减负（2026-11-03，站长：「手机端……现在都看不见历史对话了」）

   问题：手机上点 ☰ 打开的抽屉里，从上到下是 标题 58 + 新建模组/圆桌/建筑换码/四个工具 190 +
   搜索 40 + 分类 46 + 备案 44 + 底栏（主题 + 项目号两行）111，375×667 的手机上历史列表只剩
   145px，一屏只露出 1 条完整的项目。

   做法：只改尺寸和排法，入口一个不少、名字不改、点法不变——
     · 七个工具（AI 圆桌、建筑、换码、贴图、建模、模型市场、我的资产）排成 4 列小方块，图标在上字在下；
       「新建模组」仍是最上面整行的大绿按钮（原来它和圆桌只占半行、靠左，看着歪）
     · 抽屉标题、搜索框、分类标签收紧；项目行矮一点
     · 备案号缩成一行小字；底栏的主题按钮和项目编号并成一行
   只在手机断点生效（同 mobile.css：max-width 820，或矮屏触屏），建模窄栏（.hx-model-open）和
   工具页（.hx-tool-open）不碰。桌面是另一个文件 roomy.css。
   11-04 加：七个工具可以折叠（mroomy.js 加「工具 ▾」按钮，默认收起，开关记在本机）。
   回滚：chat.html 摘掉 mroomy.css / mroomy.js 那两行。
   ===================================================================== */
/* 「工具 ▾」只在手机上出现 */
#mToolsToggle { display: none !important; }

@media (max-width: 820px), (max-height: 520px) and (pointer: coarse) {
  /* ---- 工具折叠（mroomy.js 给 .create-actions 加 has-mtools，展开时加 m-tools-open） ---- */
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) .create-actions.has-mtools > #newProject {
    grid-column: 1 / 4 !important;
  }
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) .create-actions.has-mtools > #mToolsToggle {
    display: flex !important;
    grid-column: 4 / 5 !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 0 4px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) .create-actions.has-mtools:not(.m-tools-open) > a.asset-create {
    display: none !important;
  }

  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) #sidebar > header {
    height: 48px !important;
    min-height: 48px !important;
  }

  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) .create-actions {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    justify-items: stretch !important;
    gap: 6px !important;
    margin: 8px 12px 2px !important;
  }
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) .create-actions > #newProject {
    grid-column: 1 / -1 !important;
    width: auto !important;
    height: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    font-size: 14px !important;
  }
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) .create-actions > a.asset-create {
    grid-column: auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: 46px !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 4px 2px 3px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    font-size: 11px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
  }
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) .create-actions > a.asset-create .mc-ico,
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) .create-actions > a.asset-create .mc-ico svg {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
    flex: none !important;
  }
  /* 「建模历史」这类挂在入口区里的整行按钮照旧整行 */
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) .create-actions > .hx-model-history-trigger {
    grid-column: 1 / -1 !important;
  }

  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) .hx-polish-search {
    margin: 8px 12px 2px !important;
    min-height: 36px !important;
    height: 36px !important;
  }
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) .hx-polish-search input {
    height: 34px !important;
    min-height: 34px !important;
  }
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) #orgBar {
    margin: 0 12px 2px !important;
  }
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) #orgBar button {
    min-height: 38px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) .hx-polish-history-label {
    padding-top: 4px !important;
    padding-bottom: 2px !important;
  }

  /* 项目行：48 起，两行字（标题 + 日期轮数）照旧，只把上下留白收一点 */
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) #projectList .project-item {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    min-height: 48px !important;
  }

  /* 备案号：一行小字 */
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) .sidebar .site-filing {
    padding: 3px 8px !important;
    font-size: 10px !important;
    line-height: 1.4 !important;
    min-height: 0 !important;
  }
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) .sidebar .site-filing a {
    min-height: 0 !important;
  }

  /* 底栏：项目编号和主题按钮并成一行（原来项目编号单独占一整行） */
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) .m-drawer-foot {
    padding-top: 6px !important;
    padding-bottom: calc(6px + var(--m-safe-b, 0px)) !important;
    gap: 6px !important;
  }
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) .m-drawer-foot .hx-id {
    order: 1 !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    min-height: 40px !important;
  }
  body[data-mobile-page=hx] #appView.shell:not(.hx-model-open):not(.hx-tool-open) .m-drawer-foot .icon {
    order: 2 !important;
    margin-left: 0 !important;
    flex: none !important;
  }
}
