/* ==========================================================================
   Mobile Knowledge / 概念知识库 — mobile-only visual layer for
   `mobile-knowledge.html` + `mobile-knowledge-detail.html`.
   Every rule is scoped to `body.mobile-page[data-page="knowledge"]`, so PC
   knowledge, Mobile Home, Mobile Products and Mobile News are unaffected.
   Shared renderers (`knowledge-standards.js`, `knowledge-search.js`,
   `knowledge-page-controller.js`, `server-utf8.mjs`) are NOT modified.

   Data reality this layer works with (see MOBILE_KNOWLEDGE_DATA_MAP.md):
   - real taxonomy = the 8 top-level sections of knowledge-terms.json
   - 152 real terms, 150 with a real local image (`images/knowledge-concepts/`)
   - the only image field is `image` (a local relative path) — never a remote URL
   - search is client-side FlexSearch over title/aliases/keywords/content
   - detail = a real mobile-only page driven by `?termId=` + the real catalog
   - `relatedTermIds` is real (2–5 ids per term) and is rendered as chips
   ========================================================================== */

/* --------------------------------------------------------------------------
   1) Header — Knowledge keeps the search icon and hides the hamburger: the
   single menu entry on mobile is the right-side "更多功能" FAB.
   -------------------------------------------------------------------------- */
html body.mobile-page[data-page="knowledge"] #mobile-header-actions [data-mobile-menu-toggle] {
  display: none !important;
}
html body.mobile-page[data-page="knowledge"] header.nav .logo-copy > span {
  font-size: 12px !important;
}

/* Hide legacy product blocks if a cached script still inserts them. */
html body.mobile-page[data-page="knowledge"] .knowledge-related-products {
  display: none !important;
}

/* --------------------------------------------------------------------------
   2) Hero: title + real badge + one search form.
   Copy is owned by `content-sync.js` / `site-content.json`
   (`.hero-head h1`, `.hero-head p`, `.hero-badge`, `#kb-search-input`,
   `.kb-search button`), so the markup keeps those exact hooks.
   -------------------------------------------------------------------------- */
html body.mobile-page[data-page="knowledge"] .kb-hero {
  padding: 6px 0 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
html body.mobile-page[data-page="knowledge"] .kb-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="knowledge"] .kb-hero-head {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin: 0 0 8px !important;
}
html body.mobile-page[data-page="knowledge"] .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="knowledge"] .hero-head p {
  margin: 0 !important;
  color: #4a5c6e !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}
html body.mobile-page[data-page="knowledge"] .hero-badge {
  display: inline-flex !important;
  align-items: center;
  flex: 0 0 auto;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(0, 172, 235, .12);
  color: #0f7ac7 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  white-space: nowrap;
}
html body.mobile-page[data-page="knowledge"] .kb-search {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 8px !important;
  margin: 0 !important;
}
html body.mobile-page[data-page="knowledge"] .kb-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="knowledge"] .kb-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="knowledge"] .kb-search-status {
  margin: 8px 0 0 !important;
  /* VA-501（Oil UI P0-3/P0-4）：12px #718199 仅 3.96:1 → #4F6579（6.05:1）。 */
  color: #4F6579 !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}
html body.mobile-page[data-page="knowledge"] .knowledge-image-notice {
  width: calc(100% - (var(--mobile-content-gutter, 20px) * 2)) !important;
  max-width: var(--mobile-content-max-width, 390px) !important;
  margin: 12px auto 0 !important;
  padding: 10px 12px !important;
  border: 1px solid rgba(148, 163, 184, .2) !important;
  border-radius: 12px !important;
  background: #f8fbfe !important;
}
html body.mobile-page[data-page="knowledge"] .knowledge-image-notice p {
  margin: 0 !important;
  color: #4F6579 !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
}

/* --------------------------------------------------------------------------
   3) Real category chips (9 = 全部 + the 8 real sections, aligned by
   `content-sync.js`) + the "知识分类" panel entry.
   Chips wrap instead of scrolling so every real category name stays readable
   at 390 — nothing is clipped and no category is hidden.
   -------------------------------------------------------------------------- */
html body.mobile-page[data-page="knowledge"] .kb-category-nav {
  width: calc(100% - (var(--mobile-content-gutter, 20px) * 2)) !important;
  max-width: var(--mobile-content-max-width, 390px) !important;
  margin: 20px auto 0 !important;
  padding: 0 !important;
}
html body.mobile-page[data-page="knowledge"] #category-filters {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  background: transparent !important;
}
html body.mobile-page[data-page="knowledge"] #category-filters .filter-chip {
  flex: 0 0 auto;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 12px !important;
  border: 1px solid rgba(148, 163, 184, .22) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .82) !important;
  color: #52667e !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}
html body.mobile-page[data-page="knowledge"] #category-filters .filter-chip.active {
  border-color: transparent !important;
  background: linear-gradient(135deg, #00aceb, #6fd4f4) !important;
  color: #002e3d !important;
  font-weight: 800 !important;
}
html body.mobile-page[data-page="knowledge"] .kb-category-bar {
  display: flex !important;
  justify-content: flex-end !important;
  margin: 8px 0 0 !important;
  padding: 0 !important;
}
html body.mobile-page[data-page="knowledge"] #kb-category-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(0, 172, 235, .3);
  border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  color: #2b72c7;
  font-size: 12px;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   4) Section + 2-column term grid (home). Cards stay light so several term
   entries are visible in one screen.
   -------------------------------------------------------------------------- */
html body.mobile-page[data-page="knowledge"] #knowledge-content {
  width: calc(100% - (var(--mobile-content-gutter, 20px) * 2)) !important;
  max-width: var(--mobile-content-max-width, 390px) !important;
  margin: 22px auto 0 !important;
  padding: 0 !important;
}
html body.mobile-page[data-page="knowledge"] #knowledge-content .section {
  margin: 0 0 18px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
html body.mobile-page[data-page="knowledge"] #knowledge-content .section.hidden { display: none !important; }
html body.mobile-page[data-page="knowledge"] #knowledge-content .section-head {
  margin: 0 0 10px !important;
  padding: 0 !important;
  border: 0 !important;
}
html body.mobile-page[data-page="knowledge"] #knowledge-content .section-head h2 {
  margin: 0 0 3px !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #18344f !important;
}
html body.mobile-page[data-page="knowledge"] #knowledge-content .section-head p {
  margin: 0 !important;
  color: #4F6579 !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}
html body.mobile-page[data-page="knowledge"] #knowledge-content .term-grid,
html body.mobile-page[data-page="knowledge"] #knowledge-content .term-grid.term-grid-auto {
  display: grid !important;
  /* Keep the final action-row width before the bookmark and like controls mount. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)) !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* The shared card is: .term-title + .term-card-content(image + paragraphs +
   standards + provenance) + .term-expand. `display:contents` lets the real
   children be laid out as one compact knowledge card without touching the
   shared renderer. */
html body.mobile-page[data-page="knowledge"] .term-card {
  display: flex !important;
  flex-direction: column !important;
  /* The shared renderer sizes cards from --knowledge-card-height and clips them.
     The mobile card must grow with its own content instead. */
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 0 !important;
  padding: 10px !important;
  border: 1px solid rgba(148, 163, 184, .2) !important;
  border-radius: var(--radius-panel) !important;
  background: #fff !important;
  box-shadow: none !important;
}
/* The filtered-out state must win over every display rule below — including the
   search-mode grid rule, which has the same specificity but appears later.
   `#knowledge-content` gives this rule the id specificity it needs. */
html body.mobile-page[data-page="knowledge"] #knowledge-content .term-card.hidden { display: none !important; }
html body.mobile-page[data-page="knowledge"] .term-card.is-deep-linked {
  border-color: rgba(0, 172, 235, .55) !important;
  background: #f2fbff !important;
}
html body.mobile-page[data-page="knowledge"] .term-card .term-card-content {
  display: contents !important;
  max-height: none !important;
  overflow: visible !important;
}
html body.mobile-page[data-page="knowledge"] .kb-preview-card .qr-card-text {
  display: contents;
}
html body.mobile-page[data-page="knowledge"] .kb-preview-link {
  order: 5;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: #176481;
  font-size: 13px;
  text-decoration: none;
}
/* Flex children must not shrink — otherwise the text collapses into the image. */
html body.mobile-page[data-page="knowledge"] .term-card .term-media,
html body.mobile-page[data-page="knowledge"] .term-card .term-title,
html body.mobile-page[data-page="knowledge"] .term-card .term-card-content > p:first-of-type,
html body.mobile-page[data-page="knowledge"] .term-card .kb-read-more {
  flex: 0 0 auto !important;
}
html body.mobile-page[data-page="knowledge"] .term-card .term-media {
  order: 1;
  margin: 0 0 8px !important;
}
html body.mobile-page[data-page="knowledge"] .term-card .term-media-visual {
  display: block !important;
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(148, 163, 184, .18) !important;
  border-radius: 10px !important;
  background: #f4fafd !important;
  overflow: hidden !important;
}
html body.mobile-page[data-page="knowledge"] .term-card .term-media-visual img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  object-fit: contain !important;
  border-radius: 0 !important;
}
html body.mobile-page[data-page="knowledge"] .term-card .term-media-note { display: none !important; }
html body.mobile-page[data-page="knowledge"] .term-card .term-title {
  order: 2;
  margin: 0 !important;
}
html body.mobile-page[data-page="knowledge"] .term-card .term-title strong {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
  color: #18344f !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
}
html body.mobile-page[data-page="knowledge"] .term-card .term-card-content > p {
  display: none !important;
}
html body.mobile-page[data-page="knowledge"] .term-card .term-card-content > p:first-of-type {
  order: 3;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
  margin: 5px 0 0 !important;
  color: #5b6f85 !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}
html body.mobile-page[data-page="knowledge"] .term-card .term-standards,
html body.mobile-page[data-page="knowledge"] .term-card .term-related,
html body.mobile-page[data-page="knowledge"] .term-card .term-expand {
  display: none !important;
}
html body.mobile-page[data-page="knowledge"] .term-card .kb-read-more {
  order: 4;
  margin-top: 8px;
  color: #0f7ac7;
  font-size: 12.5px;
  font-weight: 800;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   5) Search result rows: thumbnail | title | summary | 查看词条 →.
   The grid only changes the shape — the same real cards, same real data.
   -------------------------------------------------------------------------- */
html body.mobile-page[data-page="knowledge"].kb-search-mode #knowledge-content .term-grid,
html body.mobile-page[data-page="knowledge"].kb-search-mode #knowledge-content .term-grid.term-grid-auto {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
}
html body.mobile-page[data-page="knowledge"].kb-search-mode .term-card:not(.hidden) {
  display: grid !important;
  grid-template-columns: 84px minmax(0, 1fr) !important;
  grid-template-areas: "media title" "media summary" "more more" !important;
  column-gap: 11px !important;
  row-gap: 4px !important;
  padding: 12px !important;
  border-radius: var(--radius-panel) !important;
}
html body.mobile-page[data-page="knowledge"].kb-search-mode .term-card .term-media {
  grid-area: media;
  margin: 0 !important;
  align-self: start;
}
html body.mobile-page[data-page="knowledge"].kb-search-mode .term-card .term-media-visual {
  aspect-ratio: 1 / 1;
  border-radius: 10px !important;
}
html body.mobile-page[data-page="knowledge"].kb-search-mode .term-card .term-title { grid-area: title; }
html body.mobile-page[data-page="knowledge"].kb-search-mode .term-card .term-title strong { -webkit-line-clamp: 2 !important; }
html body.mobile-page[data-page="knowledge"].kb-search-mode .term-card .term-card-content > p:first-of-type {
  grid-area: summary;
  align-self: start !important;
  margin: 0 !important;
  -webkit-line-clamp: 2 !important;
}
html body.mobile-page[data-page="knowledge"].kb-search-mode .term-card .term-title,
html body.mobile-page[data-page="knowledge"].kb-search-mode .term-card .term-media,
html body.mobile-page[data-page="knowledge"].kb-search-mode .term-card .kb-read-more {
  align-self: start !important;
}
html body.mobile-page[data-page="knowledge"].kb-search-mode .term-card .kb-read-more { grid-area: more; margin-top: 4px; }

/* --------------------------------------------------------------------------
   6) Pager (the real per-section pagination of the shared controller).
   -------------------------------------------------------------------------- */
html body.mobile-page[data-page="knowledge"] #knowledge-content .section-pager {
  margin: 10px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
html body.mobile-page[data-page="knowledge"] #knowledge-content .pager-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
}
html body.mobile-page[data-page="knowledge"] #knowledge-content .pager-actions button {
  min-width: 34px !important;
  height: 32px !important;
  padding: 0 10px !important;
  border: 1px solid rgba(148, 163, 184, .22) !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: #52667e !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

/* B4B directory action clearance: keep real entry links intrinsic and leave
   the shared mobile more-action FAB outside the readable action row. */
html body.mobile-page[data-page="knowledge"] .term-card .kb-read-more {
  align-self: flex-start;
  justify-self: start;
  width: max-content;
  max-width: calc(100% - 52px);
  text-align: left;
}
html body.mobile-page[data-page="knowledge"] .site-context-notice--knowledge .site-context-notice__inner {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "label" "text" "link";
}
html body.mobile-page[data-page="knowledge"] .site-context-notice--knowledge a {
  align-self: flex-start;
  justify-self: start;
  width: max-content;
  max-width: calc(100% - 52px);
  margin-left: 0;
  margin-right: auto;
  text-align: left;
}
html body.mobile-page[data-page="knowledge"] #knowledge-content .pager-actions button.active {
  border-color: transparent !important;
  background: linear-gradient(135deg, #00aceb, #6fd4f4) !important;
  color: #002e3d !important;
  font-weight: 800 !important;
}
html body.mobile-page[data-page="knowledge"] #knowledge-content .pager-ellipsis {
  color: #98a6b8 !important;
  font-size: 12px !important;
}

/* --------------------------------------------------------------------------
   7) Empty state (the real one rendered by knowledge-standards.js).
   -------------------------------------------------------------------------- */
html body.mobile-page[data-page="knowledge"] #empty-state {
  display: none !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="knowledge"] #empty-state.visible { display: block !important; }
html body.mobile-page[data-page="knowledge"] #empty-state strong {
  display: block !important;
  margin: 0 0 6px !important;
  color: #18344f !important;
  font-size: 15px !important;
}
html body.mobile-page[data-page="knowledge"] #empty-state p {
  margin: 0 !important;
  color: #718199 !important;
  font-size: 12.5px !important;
  line-height: 1.6 !important;
}
html body.mobile-page[data-page="knowledge"] #empty-state .empty-state-actions {
  margin: 12px 0 0 !important;
  display: flex !important;
  justify-content: center !important;
}
html body.mobile-page[data-page="knowledge"] #empty-state .kb-empty-reset {
  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;
}

/* --------------------------------------------------------------------------
   8) "知识分类" bottom sheet — same interaction language as the frozen News
   category panel (no second drawer, no second hamburger).
   -------------------------------------------------------------------------- */
html body.mobile-page[data-page="knowledge"] #kb-category-scrim {
  position: fixed;
  inset: 0;
  z-index: 1180;
  display: none;
  background: rgba(11, 37, 64, .32);
}
html body.mobile-page[data-page="knowledge"].kb-category-open #kb-category-scrim { display: block; }
html body.mobile-page[data-page="knowledge"] #kb-category-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1190;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: 64dvh;
  padding: 0;
  border-radius: var(--radius-drawer) var(--radius-drawer) 0 0;
  background: #f7fcfe;
  box-shadow: 0 -16px 40px rgba(24, 48, 80, .18);
  transform: translateY(102%);
  transition: transform .24s ease;
}
html body.mobile-page[data-page="knowledge"].kb-category-open #kb-category-panel { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  html body.mobile-page[data-page="knowledge"] #kb-category-panel { transition: none; }
}
html body.mobile-page[data-page="knowledge"] #kb-category-panel .ncp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(216, 229, 243, .9);
  background: #fff;
  border-radius: var(--radius-drawer) var(--radius-drawer) 0 0;
}
html body.mobile-page[data-page="knowledge"] #kb-category-panel .ncp-head strong {
  font-size: 16px;
  font-weight: 800;
  color: #172b44;
}
html body.mobile-page[data-page="knowledge"] #kb-category-panel .ncp-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f0f5fb;
  color: #4c617a;
  font-size: 18px;
}
html body.mobile-page[data-page="knowledge"] #kb-category-panel .ncp-list {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding: 12px 16px 16px;
}
html body.mobile-page[data-page="knowledge"] #kb-category-panel .ncp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 12px;
  background: #fff;
  color: #1c3049;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}
html body.mobile-page[data-page="knowledge"] #kb-category-panel .ncp-item.is-active {
  border-color: rgba(0, 172, 235, .5);
  background: #e9f7ff;
  color: #00698f;
}
html body.mobile-page[data-page="knowledge"] #kb-category-panel .ncp-item small {
  color: #4F6579;
  font-size: 12px;
  font-weight: 600;
}
html body.mobile-page[data-page="knowledge"] #kb-category-panel .ncp-foot {
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(216, 229, 243, .9);
  background: #fff;
}
html body.mobile-page[data-page="knowledge"] #kb-category-panel .ncp-apply {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #00aceb, #6fd4f4);
  color: #002e3d;
  font-size: 14px;
  font-weight: 800;
}
html body.mobile-page[data-page="knowledge"].kb-category-open .mobile-more-fab { display: none !important; }

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

/* --------------------------------------------------------------------------
   10) Term detail page (mobile-knowledge-detail.html). Long-form reading
   typography, full-width diagram, real related-term chips.
   -------------------------------------------------------------------------- */
html body.mobile-page.kb-detail-page .kb-detail-wrap {
  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.kb-detail-page .kbd-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  color: #2b72c7 !important;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none !important;
}
html body.mobile-page.kb-detail-page .kbd-article { display: block; padding-bottom: 96px; }
html body.mobile-page.kb-detail-page .kbd-meta { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px !important; }
html body.mobile-page.kb-detail-page .kbd-cat {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(0, 172, 235, .1);
  color: #0f7ac7;
  font-size: 12px;
  font-weight: 700;
}
html body.mobile-page.kb-detail-page .kbd-title {
  margin: 0 0 10px !important;
  color: #18344f;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
html body.mobile-page.kb-detail-page .kbd-summary {
  margin: 0 0 16px !important;
  padding: 12px 14px !important;
  border: 1px solid rgba(0, 172, 235, .18) !important;
  border-radius: 12px !important;
  background: #f2fbff !important;
  color: #23425c !important;
  font-size: 14px !important;
  line-height: 1.8 !important;
}
html body.mobile-page.kb-detail-page .kbd-body { display: block; }
html body.mobile-page.kb-detail-page .kbd-body h2 {
  margin: 20px 0 8px !important;
  color: #14314c;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
}
html body.mobile-page.kb-detail-page .kbd-body h2:first-child { margin-top: 0 !important; }
html body.mobile-page.kb-detail-page .kbd-body p {
  margin: 0 0 14px;
  color: #22384f;
  font-size: 15px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}
/* Principle / structure diagrams: shown whole, caption below, never cropped. */
html body.mobile-page.kb-detail-page .kbd-body .term-media {
  display: block;
  margin: 4px 0 18px !important;
}
html body.mobile-page.kb-detail-page .kbd-body .term-media-visual {
  display: block;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 14px;
  background: #fff;
}
html body.mobile-page.kb-detail-page .kbd-body .term-media-visual img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  border-radius: 8px !important;
}
html body.mobile-page.kb-detail-page .kbd-body .term-media-note {
  display: block !important;
  margin: 8px 0 0 !important;
  color: #4F6579 !important;
  font-size: 12px !important;
  line-height: 1.6 !important;
}
html body.mobile-page.kb-detail-page .kbd-body .term-standards {
  display: block;
  margin: 0 0 16px !important;
  padding: 12px 14px !important;
  border: 1px solid rgba(148, 163, 184, .2) !important;
  border-radius: 12px !important;
  background: #f7fcfe !important;
}
html body.mobile-page.kb-detail-page .kbd-body .term-standards-title {
  display: block;
  margin-bottom: 6px;
  color: #14314c;
  font-size: 13px;
  font-weight: 800;
}
html body.mobile-page.kb-detail-page .kbd-body .term-standards-list { margin: 0 !important; padding-left: 18px !important; }
html body.mobile-page.kb-detail-page .kbd-body .term-standards-list li {
  margin: 0 0 4px !important;
  color: #3c556e;
  font-size: 12.5px;
  line-height: 1.6;
}
html body.mobile-page.kb-detail-page .kbd-body .term-related:not(.term-provenance) { display: none !important; }
html body.mobile-page.kb-detail-page .kbd-body .term-provenance {
  display: block !important;
  margin: 18px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
html body.mobile-page.kb-detail-page .kbd-body .term-byline {
  margin: 0 !important;
  color: #8a99ab;
  font-size: 12px;
  line-height: 1.6;
}
html body.mobile-page.kb-detail-page .kbd-related {
  display: block;
  margin: 22px 0 0 !important;
  padding: 14px 0 0 !important;
  border-top: 1px solid rgba(148, 163, 184, .2) !important;
}
html body.mobile-page.kb-detail-page .kbd-related[hidden] { display: none !important; }
html body.mobile-page.kb-detail-page .kbd-related h2 {
  margin: 0 0 10px !important;
  color: #14314c;
  font-size: 15px;
  font-weight: 800;
}
html body.mobile-page.kb-detail-page .kbd-related-list { display: flex; flex-wrap: wrap; gap: 8px; }
html body.mobile-page.kb-detail-page .kbd-related-list a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(0, 172, 235, .3);
  border-radius: 999px;
  background: #fff;
  color: #0f7ac7;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
html body.mobile-page.kb-detail-page .kbd-byline {
  margin: 18px 0 0 !important;
  color: #8a99ab;
  font-size: 12px;
  line-height: 1.6;
}
html body.mobile-page.kb-detail-page .kbd-state { margin: 10px 0 0 !important; color: #718199; font-size: 13px; line-height: 1.7; }
html body.mobile-page.kb-detail-page .kbd-state a { color: #2b72c7; font-weight: 700; }
html body.mobile-page.kb-detail-page .kb-detail-source { display: none !important; }

/* --------------------------------------------------------------------------
   11) Detail reading-safe zone (FAB).
   The fixed FAB is 52px at the right edge (left 322..374 at 390, 362..414 at 430).
   No readable text may sit under it, so text surfaces keep a right gutter while
   the diagram keeps the full column width. Placed last and id-scoped on purpose:
   the earlier `.kbd-summary` / `.kbd-related` rules set the `padding` shorthand
   with `!important`, so only a stronger + later rule can win.
   -------------------------------------------------------------------------- */
html body.mobile-page.kb-detail-page #kbd-body > p,
html body.mobile-page.kb-detail-page #kbd-body > h2,
html body.mobile-page.kb-detail-page #kbd-body > .term-standards,
html body.mobile-page.kb-detail-page #kbd-body > .term-provenance,
html body.mobile-page.kb-detail-page #kbd-body .term-media-note,
html body.mobile-page.kb-detail-page #kbd-body .term-standards-list li,
html body.mobile-page.kb-detail-page #kbd-summary,
html body.mobile-page.kb-detail-page #kbd-title,
html body.mobile-page.kb-detail-page #kbd-related,
html body.mobile-page.kb-detail-page #kbd-related .kbd-related-list,
html body.mobile-page.kb-detail-page #kbd-state,
html body.mobile-page.kb-detail-page .kbd-meta,
html body.mobile-page.kb-detail-page .kbd-back {
  padding-right: 56px !important;
}
html body.mobile-page.kb-detail-page #kbd-summary,
html body.mobile-page.kb-detail-page #kbd-body > .term-standards {
  padding-right: 70px !important;
}
/* Shared accent across Mobile term-detail section headings. */
html body.mobile-page.kb-detail-page #kbd-article :is(h2,h3) {
  position: relative; padding-left: 8px !important;
}
html body.mobile-page.kb-detail-page #kbd-article :is(h2,h3)::before {
  content: ''; position: absolute; left: 0; top: .2em;
  width: 3px; height: 1em; border-radius: 2px;
  background: #00aceb;
}

/* Compact category row: the real category chips remain controller inputs,
   while their labels are presented in the existing category dialog. */
html body.mobile-page[data-page="knowledge"] #category-filters {
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 8px !important;
}
html body.mobile-page[data-page="knowledge"] #category-filters .filter-chip:not([data-category="all"]) {
  display: none !important;
}
html body.mobile-page[data-page="knowledge"] #category-filters .kb-category-bar {
  flex: 1 1 0;
  min-width: 0;
  margin: 0 !important;
}
html body.mobile-page[data-page="knowledge"] #kb-category-toggle {
  width: 100%;
  min-width: 0;
  height: 34px;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
}
html body.mobile-page[data-page="knowledge"] .kb-category-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Most source diagrams are 16:9. Use one wide frame; contain keeps other
   source proportions complete as well. */
html body.mobile-page[data-page="knowledge"] .term-card .term-media-visual,
html body.mobile-page[data-page="knowledge"].kb-search-mode .term-card .term-media-visual {
  aspect-ratio: 1672 / 941;
}
html body.mobile-page[data-page="knowledge"] .term-card {
  gap: 0 !important;
}
html body.mobile-page[data-page="knowledge"] .term-card .term-media {
  border: 0 !important;
  background: transparent !important;
}
html body.mobile-page[data-page="knowledge"] .term-card .term-title {
  min-height: 0 !important;
  padding: 0 !important;
}
html body.mobile-page[data-page="knowledge"] .term-card .term-card-content > p:first-of-type,
html body.mobile-page[data-page="knowledge"].kb-search-mode .term-card .term-card-content > p:first-of-type {
  -webkit-line-clamp: 3 !important;
  margin-top: 4px !important;
}
html body.mobile-page[data-page="knowledge"] .term-card .kb-card-actions {
  order: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  min-width: 0;
  margin-top: auto;
  padding-top: 8px;
}
html body.mobile-page[data-page="knowledge"] .kb-card-actions .term-engagement {
  --term-action-width: 28px;
  --term-action-height: 34px;
  gap: 2px;
  margin: 0;
}
html body.mobile-page[data-page="knowledge"] .term-card .kb-card-actions .kb-read-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  align-self: center !important;
  justify-self: end;
  width: auto;
  max-width: none;
  min-height: 32px;
  margin: 0 0 0 auto;
  gap: 3px;
  padding: 0 5px;
  border: 1px solid rgba(0, 172, 235, .22);
  border-radius: 8px;
  background: #f3fbff;
  color: #0f7ac7;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
@media (max-width: 389px) {
  html body.mobile-page[data-page="knowledge"] .kb-read-more-arrow {
    display: none;
  }
}
html body.mobile-page[data-page="knowledge"].kb-search-mode .term-card .kb-card-actions {
  grid-area: more;
  padding-top: 4px;
}
html body.mobile-page[data-page="knowledge"] #kb-category-panel[aria-hidden="true"] {
  visibility: hidden;
  pointer-events: none;
}

/* Detail order: title, original image, summary, composed paragraphs. */
html body.mobile-page.kb-detail-page #kbd-back {
  min-height: 36px;
  margin: 0 0 14px;
  padding: 0 12px !important;
  border: 1px solid #d6e8f3;
  border-radius: 999px;
  background: rgba(255, 255, 255, .85);
  color: #486278 !important;
  font-size: 12px;
  font-weight: 600;
}
html body.mobile-page.kb-detail-page .kbd-article { padding-bottom: 16px; }
html body.mobile-page.kb-detail-page #kbd-media .term-media {
  margin: 0 0 14px !important;
}
html body.mobile-page.kb-detail-page #kbd-media .term-media-visual {
  padding: 0;
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
html body.mobile-page.kb-detail-page #kbd-media .term-media-visual img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
}
html body.mobile-page.kb-detail-page #kbd-media .term-media-note {
  margin: 6px 0 0 !important;
  padding-right: 56px;
  color: #4F6579;
  font-size: 12px;
  line-height: 1.6;
}

/* VA-502（Oil UI P1-8）：知识库页头与其他手机页统一白底（此前 header 透明，
   页面蓝渐变从 y=0 透上来把 64px header 染色；产品/资讯页 header 为白底）。 */
html body.mobile-page[data-page="knowledge"] header.nav {
  background: rgba(255, 255, 255, .86) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
