/* Public search owner. Reference: the PC homepage search pill.
   Stable form IDs limit the compatibility rules to actual search controls.
   !important is needed here to override the existing glass/mobile search resets;
   it never targets Admin, ordinary forms, filters, tabs or other action buttons. */
:root {
  --ui-search-height: 68px;
  --ui-search-button-height: 48px;
  --ui-search-font-size: 15px;
  --ui-search-padding-start: 22px;
  --ui-search-padding-end: 12px;
  --ui-search-button-padding: 28px;
  --ui-search-gap: 10px;
  --ui-search-icon-size: 20px;
  --ui-search-radius: 999px;
  --ui-search-max-width: 880px;
  --ui-search-surface: #fff;
  --ui-search-text: #002e3d;
  --ui-search-border: rgba(22, 48, 71, .10);
  --ui-search-shadow: 0 18px 40px rgba(12, 36, 64, .16);
  --ui-search-focus-shadow: 0 18px 40px rgba(12, 36, 64, .16), 0 0 0 4px rgba(0, 172, 235, .12);
  --ui-search-button-surface: linear-gradient(135deg, #00aceb, #6fd4f4);
  --ui-search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371869a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='m16 16 4 4'/%3E%3C/svg%3E");
}

html body[data-page] :is(#home-search-shell, #site-search-form, #hero-product-search-form, #news-search-form, #kb-search-form, #tools-search-form, #forum-search-form, #gbq-search-form).ui-search {
  box-sizing: border-box;
  position: relative;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: var(--ui-search-gap) !important;
  width: min(var(--ui-search-max-width), 100%) !important;
  max-width: var(--ui-search-max-width) !important;
  min-width: 0;
  height: var(--ui-search-height) !important;
  min-height: var(--ui-search-height) !important;
  margin-inline: auto !important;
  padding: 0 var(--ui-search-padding-end) 0 var(--ui-search-padding-start) !important;
  border: 1px solid var(--ui-search-border) !important;
  border-radius: var(--ui-search-radius) !important;
  background: var(--ui-search-surface) !important;
  box-shadow: var(--ui-search-shadow) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html body[data-page] :is(#site-search-form, #hero-product-search-form, #news-search-form, #kb-search-form, #tools-search-form, #forum-search-form, #gbq-search-form).ui-search::before,
.ui-search .ui-search__icon {
  content: '' !important;
  display: block;
  position: static !important;
  flex: 0 0 var(--ui-search-icon-size);
  width: var(--ui-search-icon-size);
  height: var(--ui-search-icon-size);
  background: var(--ui-search-icon) center / contain no-repeat !important;
  pointer-events: none;
}

html body[data-page] :is(#home-search-shell, #site-search-form, #hero-product-search-form, #news-search-form, #kb-search-form, #tools-search-form, #forum-search-form, #gbq-search-form).ui-search input[type="search"] {
  box-sizing: border-box;
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: 0 !important;
  height: calc(var(--ui-search-height) - 2px) !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: var(--ui-search-text) !important;
  font-size: var(--ui-search-font-size) !important;
  outline: none;
}

/* PC search focus belongs to the pill container; avoid a second input box. */
html body[data-page]:not(.mobile-page) :is(#home-search-shell, #site-search-form, #hero-product-search-form, #news-search-form, #kb-search-form, #tools-search-form, #forum-search-form, #gbq-search-form).ui-search input[type="search"]:is(:focus, :focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}

html body[data-page] :is(#home-search-shell, #site-search-form, #hero-product-search-form, #news-search-form, #kb-search-form, #tools-search-form, #forum-search-form, #gbq-search-form).ui-search button[type="submit"] {
  box-sizing: border-box;
  display: inline-flex;
  flex: 0 0 auto !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: 0 !important;
  height: var(--ui-search-button-height) !important;
  min-height: var(--ui-search-button-height) !important;
  padding: 0 var(--ui-search-button-padding) !important;
  border: 0 !important;
  border-radius: var(--ui-search-radius) !important;
  background: var(--ui-search-button-surface) !important;
  box-shadow: 0 12px 26px rgba(0, 172, 235, .16) !important;
  color: var(--ui-search-text) !important;
  font-size: var(--ui-search-font-size) !important;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transform: none !important;
  transition: filter .18s ease;
}

html body[data-page] :is(#home-search-shell, #site-search-form, #hero-product-search-form, #news-search-form, #kb-search-form, #tools-search-form, #forum-search-form, #gbq-search-form).ui-search:focus-within {
  border-color: rgba(0, 172, 235, .45) !important;
  box-shadow: var(--ui-search-focus-shadow) !important;
}

.ui-search button[type="submit"]:hover { filter: brightness(.93); }
.ui-search button[type="submit"]:focus-visible { outline: 2px solid #0087b3; outline-offset: 2px; }
.ui-search button[type="submit"]:disabled { opacity: .55; cursor: not-allowed; }

/* Secondary, live brand filters use the same pill family without a fake submit action. */
html body[data-page] :is(#desktop-brand-search, #mobile-brand-search).ui-search-input--compact {
  box-sizing: border-box;
  width: 100%;
  height: 44px !important;
  padding: 0 14px 0 42px !important;
  border: 1px solid var(--ui-search-border) !important;
  border-radius: var(--ui-search-radius) !important;
  background: var(--ui-search-icon) 14px center / 18px 18px no-repeat var(--ui-search-surface) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: var(--ui-search-text);
  font-size: 14px;
}
html body[data-page] :is(#desktop-brand-search, #mobile-brand-search).ui-search-input--compact:focus-visible {
  outline: 2px solid #0087b3;
  outline-offset: 2px;
}

body.mobile-page {
  --ui-search-height: 56px;
  --ui-search-button-height: 40px;
  --ui-search-font-size: 14px;
  --ui-search-padding-start: 16px;
  --ui-search-padding-end: 8px;
  --ui-search-button-padding: 18px;
  --ui-search-gap: 8px;
  --ui-search-icon-size: 18px;
  --ui-search-shadow: 0 8px 22px rgba(12, 36, 64, .10);
  --ui-search-focus-shadow: 0 8px 22px rgba(12, 36, 64, .10), 0 0 0 4px rgba(0, 172, 235, .12);
}

/* Catalog search introductions: product library is the layout reference.
   Only opted-in hero containers lose their backing card, never content cards. */
html body[data-page] :is(.hero, .publish-hero, .kb-hero):has(> .ui-search-hero) {
  padding: 24px 0 12px !important;
}
html body[data-page] :is(.hero, .publish-hero, .kb-hero) > .container.ui-search-hero {
  --ui-search-max-width: 760px;
  padding: 0 32px !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html body[data-page] .container.ui-search-hero::before,
html body[data-page] .container.ui-search-hero::after { content: none !important; }
html body[data-page] .container.ui-search-hero :is(.hero-product-search, .search-head, .kb-hero-head) {
  display: block !important;
  width: min(760px, 100%) !important;
  margin: 0 auto !important;
  padding: 0 !important;
  text-align: center !important;
}
html body[data-page] .container.ui-search-hero :is(.hero-product-search h2, .search-head h1, .kb-hero-head h1) {
  margin: 0 0 12px !important;
  color: #172033 !important;
  /* VA-502（Oil UI P1-1）：PC 页标题回归 type-page-title 30px（原 clamp 22-26）。 */
  font-size: var(--type-page-title-size, 30px) !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: -.01em !important;
  text-align: inherit;
}
html body[data-page] .container.ui-search-hero :is(.hero-product-search > p, .search-head p, .kb-hero-head p) {
  max-width: 560px !important;
  margin: 0 auto !important;
  color: var(--ink-muted) !important;
  font-size: 13.5px !important;
  line-height: 1.65 !important;
  text-align: inherit;
}
html body[data-page] .ui-search-hero :is(#hero-product-search-form, #news-search-form, #kb-search-form).ui-search { margin-top: 18px !important; }
html body[data-page] .container.ui-search-hero :is(.ui-search-hero__meta, .kb-hero-stats) {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 12px auto 0;
  gap: 8px;
}
html body[data-page] .container.ui-search-hero :is(.news-search-status, .kb-search-status) {
  max-width: 760px !important;
  margin: 8px auto 0 !important;
  text-align: center !important;
  justify-content: center;
}
html body.mobile-page[data-page] :is(.hero, .publish-hero, .kb-hero):has(> .ui-search-hero) {
  padding: 18px 0 12px !important;
}
html body.mobile-page[data-page] :is(.hero, .publish-hero, .kb-hero) > .container.ui-search-hero {
  padding: 0 !important;
}
html body.mobile-page[data-page] .container.ui-search-hero :is(.hero-product-search, .search-head, .kb-hero-head) {
  text-align: left !important;
}
html body.mobile-page[data-page] .container.ui-search-hero :is(.hero-product-search h2, .search-head h1, .kb-hero-head h1) {
  font-size: var(--type-page-title-size, 20px) !important;
  line-height: 1.18 !important;
  letter-spacing: 0 !important;
}
html body.mobile-page[data-page] .container.ui-search-hero :is(.hero-product-search > p, .search-head p, .kb-hero-head p) {
  font-size: 13px !important;
  line-height: 1.55 !important;
}

@media (prefers-reduced-motion: reduce) {
  .ui-search button[type="submit"] { transition: none; }
}

/* ==========================================================================
   PC 搜索视觉契约（2026-10-08）：首页搜索胶囊 = 唯一基准（SINGLE SOURCE OF
   TRUTH）。作用域 = 三个 opt-in hero 页（产品库/行业资讯/知识库）的 PC 视图；
   首页壳（#home-search-shell/#site-search-form）刻意不在作用域内——首页渲染
   零变化。取值逐项抄自首页实测 computed styles
   （outputs/PC_SEARCH_VISUAL_UNIFICATION/metrics/search-computed-before.json）。
   特异性 (1,5,2)+!important 有意压过各页历史覆盖（publish-redesign 的 3px
   聚焦环、products 的去投影 token、news 的占位符灰）。Mobile 仍走上方
   body.mobile-page 令牌分支，不受本段影响。
   ========================================================================== */
html body[data-page]:not(.mobile-page) .ui-search-hero :is(#hero-product-search-form, #news-search-form, #kb-search-form).ui-search {
  box-shadow: 0 18px 40px rgba(12, 36, 64, .16) !important;
}

html body[data-page]:not(.mobile-page) .ui-search-hero :is(#hero-product-search-form, #news-search-form, #kb-search-form).ui-search:focus-within {
  border-color: rgba(0, 172, 235, .45) !important;
  box-shadow: 0 18px 40px rgba(12, 36, 64, .16), 0 0 0 4px rgba(0, 172, 235, .12) !important;
}

html body[data-page]:not(.mobile-page) .ui-search-hero :is(#hero-product-search-form, #news-search-form, #kb-search-form).ui-search button[type="submit"] {
  /* VA-501（Oil UI P0-1）：白字在品牌渐变蓝上约 2.6:1 → 深墨前景（品牌蓝上 5.56:1）。 */
  color: #002E3D !important;
  font-weight: 600 !important;
}

html body[data-page]:not(.mobile-page) .ui-search-hero :is(#hero-product-search-form, #news-search-form, #kb-search-form).ui-search input[type="search"]::placeholder {
  color: rgba(51, 65, 85, .82) !important;
}

/* — PC hero search width（2026-10-08 追加，用户复核裁决）：胶囊最大宽度归一
   880px（首页基准），不再保留三页 760px。:has(表单 ID) 守卫 = 仅产品库/资讯/
   知识库三页生效，tools/forum/gbq 等其他 ui-search-hero 页面维持原状；标题/
   副标题居中构图不受影响（居中文本在加宽容器中位置不变）；热门品牌行回钉
   760px 居中，防加宽后 chip 重排。 */
html body[data-page]:not(.mobile-page) .ui-search-hero:has(:is(#hero-product-search-form, #news-search-form, #kb-search-form)) {
  --ui-search-max-width: 880px !important;
}

html body[data-page]:not(.mobile-page) .ui-search-hero:has(:is(#hero-product-search-form, #news-search-form, #kb-search-form)) :is(.hero-product-search, .search-head, .kb-hero-head) {
  width: min(880px, 100%) !important;
}

html body[data-page]:not(.mobile-page) .ui-search-hero:has(#hero-product-search-form) .product-quick-searches {
  max-width: 760px !important;
  margin-inline: auto !important;
}

/* — 标题块回钉 760px（2026-10-08）：宽度归一仅作用于胶囊；三页 hero 标题块
   在加宽的容器内回钉原宽居中，保证标题盒子与改前逐像素一致（§标题位置不动）。 */
html body[data-page]:not(.mobile-page) .ui-search-hero:has(:is(#hero-product-search-form, #news-search-form, #kb-search-form)) :is(.hero-product-search h2, .search-head h1, .kb-hero-head h1) {
  max-width: 760px !important;
  margin-inline: auto !important;
}


/* =====================================================================
   VA-510（第七批，P1-5 搜索胶囊裁决 A）：搜索提交统一为单一规格。
   PC 48 / ≤768px 手机 44，999 胶囊圆角，15px（手机 14px）·600 字重，
   品牌蓝渐变底 + 深墨前景 #002E3D（在 #00ACEB 上 5.56:1，渐变末端更高）。
   覆盖此前每页一个尺寸的表单（PC 论坛 42、手机首页/产品 44/12、手机搜索/知识库 40、
   手机论坛 44/24、手机发布 44/13）；只改提交按钮，不改变各页搜索框容器与发光（页内自有）。
   注意：选择器直接按表单 id 收口，因此不要求表单挂 .ui-search 类。 */
:root {
  --ui-search-pill-height-mobile: 44px;
  --ui-search-pill-font-mobile: 14px;
}

html body[data-page] :is(
  #home-search-shell, #site-search-form, #hero-product-search-form, #news-search-form,
  #kb-search-form, #tools-search-form, #forum-search-form, #community-search-form, #gbq-search-form
) button[type="submit"] {
  box-sizing: border-box;
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 0 !important;
  height: var(--ui-search-button-height, 48px) !important;
  min-height: var(--ui-search-button-height, 48px) !important;
  padding: 0 var(--ui-search-button-padding, 28px) !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--ui-search-button-surface) !important;
  color: #002E3D !important;
  -webkit-text-fill-color: #002E3D !important;
  font-size: var(--ui-search-font-size, 15px) !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  white-space: nowrap;
  cursor: pointer;
  transform: none !important;
  transition: filter .18s ease;
}

html body[data-page] :is(
  #home-search-shell, #site-search-form, #hero-product-search-form, #news-search-form,
  #kb-search-form, #tools-search-form, #forum-search-form, #community-search-form, #gbq-search-form
) button[type="submit"]:hover {
  filter: brightness(.93);
}

html body[data-page] :is(
  #home-search-shell, #site-search-form, #hero-product-search-form, #news-search-form,
  #kb-search-form, #tools-search-form, #forum-search-form, #community-search-form, #gbq-search-form
) button[type="submit"]:focus-visible {
  outline: 2px solid #0087b3;
  outline-offset: 2px;
}

html body[data-page] :is(
  #home-search-shell, #site-search-form, #hero-product-search-form, #news-search-form,
  #kb-search-form, #tools-search-form, #forum-search-form, #community-search-form, #gbq-search-form
) button[type="submit"]:disabled {
  opacity: .55;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  html body[data-page] :is(
    #home-search-shell, #site-search-form, #hero-product-search-form, #news-search-form,
    #kb-search-form, #tools-search-form, #forum-search-form, #community-search-form, #gbq-search-form
  ) button[type="submit"] {
    height: var(--ui-search-pill-height-mobile) !important;
    min-height: var(--ui-search-pill-height-mobile) !important;
    padding: 0 20px !important;
    font-size: var(--ui-search-pill-font-mobile) !important;
  }
}

/* 参数命中徽标：产品名/摘要没有出现关键词、由标准参数命中时展示，
   让“IML 材质 / C 级”这类结果有明确的命中原因。 */
.param-hit-badge {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 172, 235, .24);
  background: rgba(0, 172, 235, .10);
  color: #0b6e93;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.param-hit-badge b {
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  color: #075d7c;
}

body[data-page="site-search"] .search-catalog-result .param-hit-badge {
  justify-self: start;
  align-self: start;
  margin: 0 12px 12px;
}

body[data-page="site-search"] .search-result-item--product .product-param-hit {
  display: flex;
  min-width: 0;
  margin-top: 6px;
}

.product-card .product-param-hit {
  margin: 6px 0 0;
  min-width: 0;
}
