/* dx_mobile_layout_v26112001.css — 移动端布局修复（表格裁切 / 引用块撑宽 / 帮助页标题）
   仅 max-width:720px 生效，桌面端零影响；不改动任何既有选择器优先级。 */

@media screen and (max-width:720px) {
  /* 1) Discuz 宽表格（会员列表、用户组、头像、站短）改为可横滑，避免被 body 裁切 */
  #ct table.dt,
  #ct table.tdat,
  #ct table.tfm {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  #ct table.dt > tbody,
  #ct table.tdat > tbody,
  #ct table.tfm > tbody {
    display: table !important;
    width: max-content;
    min-width: 100%;
  }

  #ct table.dt > caption,
  #ct table.tdat > caption,
  #ct table.tfm > caption {
    display: table-caption;
    width: 100%;
  }

  /* 2) 引用回复卡片：允许换行，避免 table-layout:fixed 下单元格被 max-content 撑到视口外 */
  body.pg_viewthread .dx-reply-context-main,
  body.pg_viewthread .dx-reply-context-preview {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.pg_viewthread .dx-reply-context-target {
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  /* 3) 帮助页：标题与右上角搜索表单在窄屏改为上下排列 */
  #ct .bm > h1.mt {
    padding-right: 0 !important;
  }

  #ct .bm > form.y {
    position: static !important;
    float: none !important;
    margin: 8px 0 0 !important;
    max-width: 100% !important;
  }

  #ct .bm > form.y input.text,
  #ct .bm > form.y .px {
    max-width: 100% !important;
  }
}

/* 桌面端帮助页安全区规则已移至全局 dx_c17（本文件仅 ≤720px 加载，桌面规则在此无效） */

@media screen and (max-width:720px) {
  /* 4) 主题管理条：17 个操作在窄屏改为单行横滑，避免堆成 170px 高的按钮墙 */
  #ct #modmenu {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 2px 2px 8px !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  #ct #modmenu > a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  #ct #modmenu > .pipe {
    display: none !important;
  }
}
