/* ==========================================================================
   Mobile Tools / 实用工具 — mobile-only presentation layer for the REAL
   standard query tool page `mobile-tool-gb-checker.html`.
   Scoped to `body.mobile-page[data-page="tools"][data-tool="gb-checker"]`, so
   the PC tool page, PC CSS and the frozen mobile pages are unaffected.

   The tool itself is reused unchanged (`tool-gb-checker.js` + the real query
   model + `tool-gb-checker.css`). This file only adapts the shell, the colour
   system, the reading-safe zone and small-screen ergonomics. No field, filter,
   result or count is added or fabricated.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1) Frozen mobile shell: search icon stays, hamburger hidden (the FAB is the
   single menu entry). Footer + FAB clearance as on the frozen pages.
   -------------------------------------------------------------------------- */
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #mobile-header-actions [data-mobile-menu-toggle] {
  display: none !important;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] header.nav .logo-copy > span {
  font-size: 12px !important;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .site-compliance-footer {
  margin-top: 18px !important;
  padding: 16px 20px calc(14px + 70px) !important;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .site-compliance-footer__main { display: none !important; }
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .site-compliance-footer__brand,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .site-compliance-footer__qr { display: none !important; }
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .site-compliance-footer::before {
  content: "智能锁产业信息平台";
  display: block;
  margin-bottom: 8px;
  color: #1d3349;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .site-compliance-footer__legal {
  padding-top: 0 !important;
  border-top: 0 !important;
  font-size: 12px !important;
  line-height: 1.7 !important;
  text-align: center !important;
}

/* --------------------------------------------------------------------------
   2) Tool head: back link + title + subtitle, on the frozen reading column.
   -------------------------------------------------------------------------- */
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .gbq-shell {
  width: calc(100% - (var(--mobile-content-gutter, 20px) * 2)) !important;
  max-width: var(--mobile-content-max-width, 390px) !important;
  margin: 0 auto !important;
  padding: 6px 0 0 !important;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .gbq-tool-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-bottom: 6px;
  padding: 0 12px;
  border: 1px solid #cde5f2;
  border-radius: 12px;
  background: rgba(255,255,255,.9);
  color: #24475d !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .gbq-tool-back svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #00aceb;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .gbq-tool-back:focus-visible {
  outline: 2px solid #00aceb;
  outline-offset: 3px;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .gbq-head { margin: 0 0 10px !important; }
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .gbq-title {
  margin: 0 0 4px !important;
  color: #18344f !important;
  font-size: 20px !important;
  line-height: 1.3 !important;
  font-weight: 800 !important;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .gbq-subtitle {
  margin: 0 !important;
  color: #4a5c6e !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
}
/* Narrow screens: the title is 16 CJK chars and would hang a single character
   ("…任务工 / 具"). Break it at the real semantic boundary instead. At ≥ 401px it
   fits on one line, so the span stays inline and nothing changes there. */
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .gbq-title-part { display: inline; }
@media (max-width: 400px) {
  html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .gbq-title-part { display: block; }
}

/* --------------------------------------------------------------------------
   3) Single-column app ergonomics at 390/430 + the frozen accent colour.
   -------------------------------------------------------------------------- */
/* Metadata lines (real badge + `电源要求 · 检测项目 T13-22 · 缺陷分类 B` /
   `条款 6 · 技术要求`) must not split a semantic phrase across lines. `keep-all`
   restricts breaks to the real spaces, so `技术要求` stays whole; `overflow-wrap`
   only kicks in if a run genuinely cannot fit (no overflow). */
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-item-head > p,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-meta {
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
  line-break: strict;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .gbq-main {
  padding-bottom: 0 !important;
  overflow-x: hidden !important;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app {
  width: calc(100% - (var(--mobile-content-gutter, 20px) * 2)) !important;
  max-width: var(--mobile-content-max-width, 390px) !important;
  margin: 0 auto !important;
  padding-bottom: 104px !important;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-search:not(.ui-search) {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-search:not(.ui-search) input {
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 14px !important;
  border: 1px solid rgba(148, 163, 184, .24) !important;
  border-radius: 12px !important;
  background: #f4fafd !important;
  color: #1c3049 !important;
  font-size: 14px !important;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-search:not(.ui-search) button {
  height: 44px !important;
  min-height: 44px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #00aceb, #6fd4f4) !important;
  color: #002e3d !important;
  font-size: 14px !important;
  font-weight: 800 !important;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-mode-switch,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-query-tabs,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-filters,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-grade-options {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}
/* The current-state badge shares the heading row instead of reserving a
   separate band above both navigation cards. */
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-mode-switch > a {
  grid-template-columns: minmax(0,1fr) auto;
  grid-template-rows: auto auto;
  align-items: center !important;
  column-gap: 4px !important;
  row-gap: 4px !important;
  min-height: 64px !important;
  padding: 10px 12px !important;
  transform: none !important;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-mode-switch > a > span {
  display: contents !important;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-mode-switch strong {
  grid-column: 1;
  grid-row: 1;
  line-height: 20px !important;
  white-space: nowrap;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-mode-switch em {
  grid-column: 1 / -1;
  grid-row: 2;
  font-size: 12px !important;
  line-height: 17px !important;
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-mode-switch > a.active::before {
  content: "已选";
  position: static;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: center;
  padding: 2px 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  box-shadow: none;
}
/* Preserve complete headings and an aligned badge on small phone screens. */
@media (max-width: 375px) {
  html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-mode-switch {
    grid-template-columns: minmax(0,1fr) !important;
  }
}
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-search-status,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-status,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .gbq-status,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] .gbq-error {
  color: #718199 !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
}
/* Wide standard tables must scroll inside their own box, never the page. */
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app table,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-grade-table,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-ocr-table-scroll {
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}
/* a11y floor: the real tool ships a few 11.5px small-print classes at mobile
   widths (source badge, clause tag, query capabilities…). None may fall below 12px. */
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-source-badge,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-src-tag,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-clause-card .cl,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-lock-extension-card dt,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-lock-extension-card dd,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-task-requirement-compare p strong,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-query-nav > header strong,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-query-capabilities,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-toc-parent-link,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-fuzzy-tag,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-live-suggestions,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-grade-shared .tag,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .tag,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app small {
  font-size: 12px !important;
  line-height: 1.5 !important;
}

/* --------------------------------------------------------------------------
   4) Reading-safe zone: the fixed 52px FAB must not cover result / detail text.
   Text-bearing surfaces keep a right gutter; the diagram-free app layout, its
   tabs and its buttons keep their natural width.
   -------------------------------------------------------------------------- */
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-result-card,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-category,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-project-browser,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-item-head,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-section,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-details:not(.gbq-inspection-details),
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-definition-body,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-note,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-src-list,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-def-list,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-ocr-table-block,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-lock-extension-card,
html body.mobile-page[data-page="tools"][data-tool="gb-checker"] #gbq-app .gbq-category-body {
  padding-right: 56px !important;
}
