/* ============================================================================
 *  手机端修补层 · dwg-touch.css   （2026-11-18 · 站长第 20 轮）
 * ----------------------------------------------------------------------------
 *  ① 图纸预览手势的容器口径
 *  ② 「放大看字」按钮：字缩一号、两字一行
 *  ③ 结算页「合格」竖排徽章压出卡片
 *  末尾加载（index.php 里排在 page.20261102a.css 之后），只覆盖不改原文件。
 * ==========================================================================*/

/* ---------- ① 手势容器 ---------- */
/* 父级 .dwg-stage 是 touch-action:none（原生手势关闭），
   滚动/缩放全部交给 dwg-touch.js；这里把内层容器一起锁住，
   并给 iOS 补上「滚动到边界不外溢」，免得捏合时整页跟着弹。 */
.dwg-svgwrap {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.dwg-svgwrap:active { cursor: grabbing; }
/* 图形本身不吃指针事件 —— 部分安卓内核在 SVG 元素上会另起一套手势 */
.dwg-svgwrap svg { touch-action: none; pointer-events: none; }

/* 倍率角标 */
.ms-zoombadge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 6;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(17, 38, 62, .82);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
}
.ms-zoombadge.on { opacity: 1; transform: translateY(0); }

/* ---------- ② 「放大看字」两字一行 ---------- */
/* 手机端：字号 15px → 12px，按 2 字一行；宽度收窄，把省下的空间让给「整张图 / ＋ / －」。
   注意 ms-fit.css 有一条 `html body .btn{font-size:16px!important;line-height:1.55!important}`
   （为了 iOS 输入聚焦不放大），普通规则压不住它 —— 这里必须同步用 !important，
   并把选择器写到 html body 一级，确保最终生效。 */
html body .dwg-viewbar .btn.dwg-btn-2l,
html body .dwg-fullbar .btn.dwg-btn-2l {
  flex: 0 0 auto;
  font-size: 12px !important;
  line-height: 1.18 !important;
  letter-spacing: .5px;
  padding: 4px 9px !important;
  min-height: 0 !important;
  height: auto !important;
  white-space: normal !important;
  text-align: center;
}
html body .dwg-fullbar .btn.dwg-btn-2l { padding: 5px 8px !important; }

/* 窄屏再收一档：390px 下四个键 + 两行小字刚好一行排满，不掉行 */
@media (max-width: 400px) {
  .dwg-viewbar { gap: 5px; }
  html body .dwg-viewbar .btn.dwg-btn-2l { padding: 4px 7px !important; font-size: 11.5px !important; }
}

/* ---------- ③ 结算页竖排徽章 ---------- */
/* .vbadge 是 absolute + min-height:46px 钉在卡片右侧；
   手机上卡片被 2 列网格压到 60px 上下时，徽章底边会越过卡片下边框
   （圆角把色块裁掉一截，看着像「合格」被切了）。 */
@media (max-width: 640px) {
  .rcard.vbadge-card { padding-right: 46px; min-height: 62px; }
  .rcard.vbadge-card .vbadge {
    right: 8px;
    min-width: 30px;
    min-height: 0;
    padding: 3px 6px;
    font-size: 14.5px;
    line-height: 1.18;
    max-height: calc(100% - 8px);
    overflow: hidden;
  }
}
