/* ==========================================================================
   Mobile Tools / 实用工具 — mobile-only visual layer for `mobile-tools.html`.
   Every rule is scoped to `body.mobile-page[data-page="tools"]`, so PC tools,
   Mobile Home / Products / News / Knowledge are unaffected. Shared renderers,
   PC files and the real tool engine are NOT modified.

   Data reality this layer works with (see MOBILE_TOOLS_IMPLEMENTATION_MAP):
   - the PC project currently ships exactly ONE usable tool
     (电子锁、机械锁标准查询与任务工具) plus a real "开发中 / 给我们提建议" module
   - the tool entry copy, the 开发中 copy and the suggestion entry are all real repo copy
   - nothing else is shown: no fabricated tool, field, filter or count
   ========================================================================== */

/* --------------------------------------------------------------------------
   1) Header — Tools keeps the search icon and hides the hamburger: the single
   menu entry on mobile is the right-side "更多功能" FAB.
   The frozen header shows no link underline; the tool page already gets that
   from `tools.css` (`body[data-page="tools"] a { text-decoration: none }`),
   which the index page does not load — so restore it here, page-scoped only.
   -------------------------------------------------------------------------- */
html body.mobile-page[data-page="tools"] header.nav a,
html body.mobile-page[data-page="tools"] header.nav a * {
  text-decoration: none !important;
}
html body.mobile-page[data-page="tools"] #mobile-header-actions [data-mobile-menu-toggle] {
  display: none !important;
}
html body.mobile-page[data-page="tools"] header.nav .logo-copy > span {
  font-size: 12px !important;
}

/* --------------------------------------------------------------------------
   2) Hero + light tool search.
   -------------------------------------------------------------------------- */
html body.mobile-page[data-page="tools"] .tools-hero {
  padding: 6px 0 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
html body.mobile-page[data-page="tools"] .tools-hero-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: 0 !important;
}
html body.mobile-page[data-page="tools"] .tools-hero-head {
  margin: 0 0 8px !important;
}
html body.mobile-page[data-page="tools"] .tools-hero-head h1 {
  margin: 0 0 2px !important;
  font-size: 20px !important;
  line-height: 1.2 !important;
  font-weight: 800 !important;
}
html body.mobile-page[data-page="tools"] .tools-hero-head p {
  margin: 0 !important;
  color: #4a5c6e !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}
html body.mobile-page[data-page="tools"] .tools-search {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 8px !important;
  margin: 0 !important;
}
html body.mobile-page[data-page="tools"] .tools-search input {
  width: 100% !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 14px 0 38px !important;
  border: 1px solid rgba(148, 163, 184, .24) !important;
  border-radius: var(--radius-control) !important;
  background-color: #f4fafd !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a6fae' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='6.6'/><path d='m16.2 16.2 4 4'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: 13px center !important;
  background-size: 18px 18px !important;
  color: #1c3049 !important;
  font-size: 14px !important;
}
html body.mobile-page[data-page="tools"] .tools-search button {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 16px !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;
  white-space: nowrap !important;
}
html body.mobile-page[data-page="tools"] .tools-search-status {
  margin: 8px 0 0 !important;
  color: #4F6579 !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}
html body.mobile-page[data-page="tools"] .tools-search-status:empty { display: none !important; }

/* --------------------------------------------------------------------------
   3) Tool catalog — real entries stacked top-to-bottom on mobile.
   -------------------------------------------------------------------------- */
html body.mobile-page[data-page="tools"] .tools-catalog {
  width: calc(100% - (var(--mobile-content-gutter, 20px) * 2)) !important;
  max-width: var(--mobile-content-max-width, 390px) !important;
  margin: 16px auto 0 !important;
  padding: 0 !important;
}
html body.mobile-page[data-page="tools"] .tools-catalog-title {
  margin: 0 0 10px !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #18344f !important;
}
html body.mobile-page[data-page="tools"] .tools-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  column-gap: 0 !important;
  row-gap: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
}
html body.mobile-page[data-page="tools"] .tool-entry {
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 12px !important;
  border: 1px solid rgba(148, 163, 184, .2) !important;
  border-radius: var(--radius-panel) !important;
  background: #fff !important;
  box-shadow: none !important;
}
html body.mobile-page[data-page="tools"] .tool-entry.hidden { display: none !important; }
html body.mobile-page[data-page="tools"] .tool-entry-icon {
  display: grid !important;
  place-items: center !important;
  width: 40px !important;
  height: 40px !important;
  margin: 0 0 8px !important;
  border-radius: 11px !important;
  background: #eef8fe !important;
  color: #0f7ac7 !important;
}
html body.mobile-page[data-page="tools"] .tool-entry-icon svg { width: 22px !important; height: 22px !important; }
html body.mobile-page[data-page="tools"] .tool-entry-dev .tool-entry-icon {
  background: #fdf3e8 !important;
  color: #b4761c !important;
}
html body.mobile-page[data-page="tools"] .tool-entry-category {
  margin: 0 0 3px !important;
  color: #4F6579 !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
}
html body.mobile-page[data-page="tools"] .tool-entry h3 {
  margin: 0 0 5px !important;
  color: #18344f !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
}
html body.mobile-page[data-page="tools"] .tool-entry-desc {
  margin: 0 0 8px !important;
  color: #5b6f85 !important;
  font-size: 12px !important;
  line-height: 1.55 !important;
}
html body.mobile-page[data-page="tools"] .tool-entry-tags {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
  list-style: none !important;
}
html body.mobile-page[data-page="tools"] .tool-entry-tags li {
  padding: 2px 7px !important;
  border-radius: 999px !important;
  background: #f2f7fc !important;
  color: #566F86 !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}
html body.mobile-page[data-page="tools"] .tool-entry-cta {
  margin-top: 0 !important;
  color: #0f7ac7 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}
/* Both cards share six content rows, including the longer development copy. */
html body.mobile-page[data-page="tools"] .tool-entry > :not(.tool-entry-cta) {
  align-self: start;
}
html body.mobile-page[data-page="tools"] .tool-entry-cta.ui-button--primary,
html body.mobile-page[data-page="tools"] .tool-entry-cta.ui-button--primary span {
  /* VA-501（Oil UI P0-1）：白字在品牌蓝上 2.59:1 → 深墨前景 5.56:1。 */
  color: #002e3d !important;
}
html body.mobile-page[data-page="tools"] .tool-entry-cta.ui-button--primary {
  border-color: #00aceb !important;
}
html body.mobile-page[data-page="tools"] .tool-entry-cta.ui-button--primary:hover {
  border-color: #009bd4 !important;
}
html body.mobile-page[data-page="tools"] .tool-entry-cta:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}
html body.mobile-page[data-page="tools"] .tool-entry-cta:focus-visible {
  outline: 2px solid #00aceb !important;
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   4) Empty state (real, from the light tool search).
   -------------------------------------------------------------------------- */
html body.mobile-page[data-page="tools"] .tools-empty {
  display: block !important;
  margin: 8px 0 0 !important;
  padding: 26px 18px !important;
  border: 1px dashed rgba(148, 163, 184, .3) !important;
  border-radius: 16px !important;
  background: #f8fbfe !important;
  text-align: center !important;
}
html body.mobile-page[data-page="tools"] .tools-empty[hidden] { display: none !important; }
html body.mobile-page[data-page="tools"] .tools-empty strong {
  display: block !important;
  margin: 0 0 6px !important;
  color: #18344f !important;
  font-size: 15px !important;
}
html body.mobile-page[data-page="tools"] .tools-empty p {
  margin: 0 !important;
  color: #718199 !important;
  font-size: 12.5px !important;
  line-height: 1.6 !important;
}
html body.mobile-page[data-page="tools"] .tools-empty-actions { margin: 12px 0 0 !important; display: flex !important; justify-content: center !important; }
html body.mobile-page[data-page="tools"] #tools-empty-reset {
  min-height: 38px !important;
  padding: 0 16px !important;
  border: 1px solid rgba(0, 172, 235, .35) !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #0f7ac7 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

/* --------------------------------------------------------------------------
   5) 开发中 state (?view=development) — the real dev copy merged with the real
   suggestion entry, in the frozen mobile shell.
   -------------------------------------------------------------------------- */
html body.mobile-page[data-page="tools"] .tools-dev-view {
  width: calc(100% - (var(--mobile-content-gutter, 20px) * 2)) !important;
  max-width: var(--mobile-content-max-width, 390px) !important;
  margin: 6px auto 0 !important;
  padding: 0 0 96px !important;
}
html body.mobile-page[data-page="tools"] .tools-dev-view[hidden] { display: none !important; }
html body.mobile-page[data-page="tools"] .tools-dev-back {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #2b72c7 !important;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none !important;
}
html body.mobile-page[data-page="tools"] .tools-dev-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 10px 0 12px;
  border-radius: 16px;
  background: #fdf3e8;
  color: #b4761c;
}
html body.mobile-page[data-page="tools"] .tools-dev-icon svg { width: 28px; height: 28px; }
html body.mobile-page[data-page="tools"] .tools-dev-eyebrow {
  margin: 0 0 4px !important;
  color: #718199 !important;
  font-size: 12px !important;
  letter-spacing: .04em;
}
html body.mobile-page[data-page="tools"] .tools-dev-title {
  margin: 0 0 10px !important;
  color: #18344f !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
}
html body.mobile-page[data-page="tools"] .tools-dev-body {
  margin: 0 0 10px !important;
  padding: 14px 16px !important;
  border: 1px solid rgba(148, 163, 184, .2) !important;
  border-radius: 14px !important;
  background: #fff !important;
  color: #22384f !important;
  font-size: 14px !important;
  line-height: 1.8 !important;
}
html body.mobile-page[data-page="tools"] .tools-dev-ask {
  margin: 0 0 14px !important;
  color: #4a5c6e !important;
  font-size: 13px !important;
  line-height: 1.7 !important;
}
html body.mobile-page[data-page="tools"] .tools-dev-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #00aceb, #6fd4f4);
  color: #002e3d !important;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none !important;
}

/* --------------------------------------------------------------------------
   6) Lightweight footer + FAB clearance (same treatment as the frozen pages).
   -------------------------------------------------------------------------- */
html body.mobile-page[data-page="tools"] .site-compliance-footer {
  margin-top: 18px !important;
  padding: 16px 20px calc(14px + 70px) !important;
}
html body.mobile-page[data-page="tools"] .site-compliance-footer__main { display: none !important; }
html body.mobile-page[data-page="tools"] .site-compliance-footer__brand,
html body.mobile-page[data-page="tools"] .site-compliance-footer__qr { display: none !important; }
html body.mobile-page[data-page="tools"] .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"] .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;
}
html body.mobile-page[data-page="tools"] .tools-scroll-top { bottom: calc(18px + env(safe-area-inset-bottom)) !important; right: calc(16px + 52px + 10px) !important; }
