/* R6A: single-owner search fields, visible lenses and native submit controls.
 * Loaded after the frozen skins. No logo, carousel, routing or data changes. */
.moviecms-search-field { display: contents; }
button.moviecms-search-submit { display: none !important; }
/* HUATV mobile hero: constrain copy, never shrink or cover the poster. */
@media (max-width: 900px) {
  html:root:root body.front.portal.front.portal header.haoju-global-header[data-r6-search-header="floating"] {
    padding-top: 0 !important; padding-left: 0 !important; padding-right: 0 !important;
  }
  html:root:root body.front.portal.front.portal header.haoju-global-header[data-r6-search-header="floating"]:not(.is-search-open) { padding-bottom: 0 !important; }
  html:root:root body.front.portal.front.portal header[class][class][class] form[data-r6-search="row"][data-r6-collapsible="true"].is-open {
    position: absolute !important; left: 8px !important; right: 8px !important;
    top: auto !important; bottom: 8px !important; width: auto !important; margin: 0 !important; z-index: 3 !important;
  }
  html:root:root body.front.portal.front.portal header[data-r6-search-header="row"][class][class].is-search-open {
    height: auto !important; min-height: 96px !important; padding-bottom: 52px !important;
  }
  html:root body.front.portal.tpl-iqiyi.iqiyi-home .hero-slide .hero-copy {
    box-sizing: border-box !important; width: 46% !important; max-width: 46% !important;
    min-width: 0 !important; padding: 52px 8px 12px 12px !important;
    justify-content: center !important; gap: 6px !important; overflow: hidden !important;
  }
  html:root body.front.portal.tpl-iqiyi.iqiyi-home .hero-copy > :is(h2,.eyebrow) {
    box-sizing: border-box !important; width: 100% !important; max-width: 100% !important;
    min-width: 0 !important; margin: 0 !important; white-space: normal !important;
    overflow-wrap: anywhere !important; overflow: hidden !important;
    display: -webkit-box !important; -webkit-box-orient: vertical !important; -webkit-line-clamp: 2 !important;
  }
  html:root body.front.portal.tpl-iqiyi.iqiyi-home .hero-copy > h2 {
    font-size: clamp(18px,5.4vw,24px) !important; line-height: 1.2 !important;
  }
  html:root body.front.portal.tpl-iqiyi.iqiyi-home .hero-copy > .eyebrow {
    font-size: clamp(10px,2.8vw,12px) !important; line-height: 1.45 !important;
  }
  html:root body.front.portal.tpl-iqiyi.iqiyi-home .hero-copy .hero-actions {
    display: flex !important; width: 100% !important; max-width: 100% !important;
    min-width: 0 !important; gap: 4px !important; margin-top: 4px !important;
  }
  html:root body.front.portal.tpl-iqiyi.iqiyi-home .hero-copy .hero-actions > a {
    box-sizing: border-box !important; flex: 1 1 0 !important; min-width: 0 !important;
    width: 0 !important; padding: 0 2px !important; column-gap: 3px !important;
    font-size: clamp(10px,2.8vw,11.5px) !important; white-space: nowrap !important;
  }
}
@media (max-width: 960px) {
  html:root:root body.front.portal.front.portal header[class][class][class] .portal-search-chip[class] {
    display: inline-flex !important; position: relative !important;
  }
  /* huatv.vip only: the 42px HTML image height outgrew its scaled 32px box. */
  html:root:root[data-r6-huatv-brand="fit"] body.front.portal header .brand-mark > img {
    display: block !important; width: 100% !important; height: 100% !important;
    min-width: 0 !important; min-height: 0 !important; max-width: 100% !important; max-height: 100% !important;
    object-fit: contain !important; object-position: center !important; margin: 0 !important;
  }
  html:root body.front.portal header {
    --r6-search-ink: #182b23;
    --r6-search-surface: #f5faf7;
    --r6-search-line: #688c79;
    --r6-search-focus: #24684a;
  }
  html:root[data-portal-theme="dark"] body.front.portal header,
  html:root[data-theme="dark"] body.front.portal header {
    --r6-search-ink: #e6f0eb;
    --r6-search-surface: #182b23;
    --r6-search-line: #779d88;
    --r6-search-focus: #b0dfc5;
  }
  /* The previous mask existed but IQIYI's legacy display:none hid its pixels. */
  html:root:root body.front.portal header[class][class] :is(.portal-search-chip,.ds3-mobile-search,.keke-search > button,.haoju-global-search[data-r6-search="floating"] > button) {
    background: var(--r6-search-surface) !important;
    border-color: var(--r6-search-line) !important;
    color: var(--r6-search-ink) !important;
  }
  html:root:root body.front.portal header[class][class] :is(.portal-search-chip,.ds3-mobile-search,.keke-search > button,.haoju-global-search[data-r6-search="floating"] > button)::before {
    display: block !important; visibility: visible !important; opacity: 1 !important;
    content: "" !important; position: absolute !important; inset: 50% auto auto 50% !important;
    width: 16px !important; height: 16px !important; transform: translate(-50%,-50%) !important;
    border: 0 !important; border-radius: 0 !important; padding: 0 !important; margin: 0 !important;
    background: var(--r6-search-ink) !important;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10' cy='10' r='6.5' fill='none' stroke='black' stroke-width='2.2'/%3E%3Cpath d='m15 15 6 6' stroke='black' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat !important;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10' cy='10' r='6.5' fill='none' stroke='black' stroke-width='2.2'/%3E%3Cpath d='m15 15 6 6' stroke='black' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat !important;
  }
  html:root:root body.front.portal header[class][class] .portal-search-chip::before {
    background-color: var(--r6-search-ink) !important;
  }
  html:root body.front.portal :is(.keke-dock,.ds3-bottom-nav) :is(a,em) {
    font-family: inherit !important; font-style: normal !important;
  }
  /* row = ordinary NUNU/HUATV form; floating = input below a compact trigger. */
  html:root:root body.front.portal.front.portal header[class][class][class] form[data-r6-search="row"] {
    display: flex !important; opacity: 1 !important; visibility: visible !important;
    pointer-events: auto !important;
    width: 100% !important; min-width: 0 !important; max-width: none !important;
    position: static !important; transform: none !important;
  }
  html:root:root body.front.portal.front.portal header[class][class][class] form[data-r6-collapsible="true"]:not(.is-open) {
    display: none !important;
  }
  html:root:root body.front.portal.front.portal header[class][class][class] :is(form[data-r6-search="row"],.moviecms-search-field) {
    box-sizing: border-box !important; height: 36px !important; min-height: 36px !important; max-height: 36px !important;
    align-items: center !important; gap: 0 !important; padding: 0 !important;
    border: 1px solid var(--r6-search-line) !important; border-radius: 18px !important;
    background: var(--r6-search-surface) !important; color: var(--r6-search-ink) !important;
    overflow: hidden !important; box-shadow: none !important; outline: none !important;
  }
  html:root:root body.front.portal.front.portal header[class][class][class] :is(form[data-r6-search="row"],.moviecms-search-field):focus-within {
    border: 2px solid var(--r6-search-focus) !important;
  }
  html:root:root body.front.portal.front.portal header[class][class][class] form[data-r6-search]:not([data-r6-search="link"]) input[type="search"] {
    box-sizing: border-box !important; flex: 1 1 0% !important; width: 0 !important;
    min-width: 0 !important; max-width: none !important; height: 100% !important; min-height: 0 !important;
    position: static !important; inset: auto !important; margin: 0 !important; padding: 0 12px !important;
    border: 0 !important; border-radius: 0 !important; outline: none !important; box-shadow: none !important;
    background: transparent !important; color: var(--r6-search-ink) !important;
    -webkit-text-fill-color: currentColor !important; font-size: 16px !important; line-height: normal !important;
  }
  html:root:root body.front.portal.front.portal header[class][class][class] form[data-r6-search]:not([data-r6-search="link"]) input::placeholder {
    color: var(--r6-search-ink) !important; opacity: .78 !important;
  }
  html:root:root body.front.portal.front.portal header[class][class][class] :is(form[data-r6-search="row"] > button,.moviecms-search-submit.moviecms-search-submit) {
    box-sizing: border-box !important; display: inline-flex !important; align-items: center !important; justify-content: center !important;
    position: static !important; inset: auto !important; flex: 0 0 58px !important;
    width: 58px !important; min-width: 58px !important; max-width: 58px !important;
    height: 100% !important; min-height: 0 !important; max-height: none !important;
    border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
    margin: 0 !important; padding: 0 10px !important; font-size: 14px !important; line-height: 1 !important;
    font-family: inherit !important; font-weight: 700 !important; color: var(--r6-search-ink) !important;
    -webkit-text-fill-color: currentColor !important; background: var(--r6-search-surface) !important;
    white-space: nowrap !important; text-shadow: none !important;
  }
  html:root:root body.front.portal.front.portal header[class][class][class] :is(form[data-r6-search="row"] > button,.moviecms-search-submit.moviecms-search-submit):focus-visible {
    outline: none !important; text-decoration: underline !important; text-underline-offset: 4px !important;
  }
  html:root:root body.front.portal.front.portal header[class][class][class] .moviecms-search-submit.moviecms-search-submit::before,
  html:root:root body.front.portal.front.portal header[class][class][class] .moviecms-search-submit.moviecms-search-submit::after {
    display: none !important; content: none !important;
  }
}
@media (max-width: 900px) {
  /* New-brand HAOJU inner pages retain a legacy grid-row:2 on the form.
   * Put the existing trigger back beside the logo; never create another one. */
  html:root:root body.front.portal.front.portal header.haoju-global-header[data-r6-search-header="floating"] .haoju-global-head {
    grid-template-columns: minmax(0,1fr) max-content max-content !important;
  }
  html:root:root body.front.portal.front.portal header.haoju-global-header[data-r6-search-header="floating"] .haoju-global-head > form.haoju-global-search[data-r6-search="floating"] {
    grid-area: 1 / 2 !important; align-self: center !important; margin: 0 !important;
    width: var(--mobile-header-control,32px) !important; min-width: var(--mobile-header-control,32px) !important;
    max-width: var(--mobile-header-control,32px) !important;
  }
  html:root:root body.front.portal.front.portal header.haoju-global-header[data-r6-search-header="floating"] .haoju-global-head > .haoju-global-actions { grid-area: 1 / 3 !important; }
  html:root:root body.front.portal.front.portal header.haoju-global-header[data-r6-inline-actions] .haoju-global-head {
    grid-template-columns: minmax(0,1fr) max-content !important;
  }
  html:root:root body.front.portal.front.portal header.haoju-global-header[data-r6-inline-actions] .haoju-global-head > .haoju-global-actions {
    grid-area: 1 / 2 !important; align-items: center !important;
  }
  html:root:root body.front.portal.front.portal header.haoju-global-header[data-r6-inline-actions] .haoju-global-actions > form.haoju-global-search[data-r6-search="floating"] {
    flex: 0 0 var(--mobile-header-control,32px) !important; order: 0 !important;
    width: var(--mobile-header-control,32px) !important; min-width: var(--mobile-header-control,32px) !important;
    max-width: var(--mobile-header-control,32px) !important; margin: 0 !important;
  }
  html:root:root body.front.portal.front.portal header[class][class][class] form.haoju-global-search[data-r6-search="floating"] > button {
    box-sizing: border-box !important; position: relative !important; display: inline-flex !important;
    inset: auto !important; transform: none !important; vertical-align: top !important;
    width: var(--mobile-header-control,32px) !important; min-width: var(--mobile-header-control,32px) !important; max-width: var(--mobile-header-control,32px) !important;
    height: var(--mobile-header-control,32px) !important; min-height: var(--mobile-header-control,32px) !important; max-height: var(--mobile-header-control,32px) !important;
    font-size: 0 !important; line-height: 0 !important; padding: 0 !important; margin: 0 !important;
    border: 1px solid var(--r6-search-line) !important; border-radius: 50% !important;
    background: var(--r6-search-surface) !important; color: var(--r6-search-ink) !important;
    box-shadow: none !important;
  }
  /* Isolated OLE's historical second-row grid area must not strand the trigger. */
  html:root body.front.portal.site-oletv-xyz header.keke-topbar[data-r6-search-header] > .keke-search {
    grid-area: 1 / 3 !important;
  }
  html:root body.front.portal.site-oletv-xyz header.keke-topbar[data-r6-search-header] {
    grid-template-columns: minmax(0,1fr) max-content max-content max-content !important;
  }
  html:root body.front.portal.site-oletv-xyz header.keke-topbar[data-r6-search-header] > .keke-menu { grid-area: 1 / 4 !important; }
  html:root:root body.front.portal.front.portal header[data-r6-search-header="floating"][class][class] form[data-r6-search="floating"] {
    position: static !important; display: block !important; overflow: visible !important;
    border: 0 !important; padding: 0 !important; background: transparent !important;
    height: var(--mobile-header-control,32px) !important; min-height: 0 !important;
  }
  html:root:root body.front.portal.front.portal header[data-r6-search-header="floating"][class][class] .moviecms-search-field {
    position: absolute !important; display: none !important;
    top: auto !important; bottom: 8px !important; left: max(8px,env(safe-area-inset-left)) !important;
    right: max(8px,env(safe-area-inset-right)) !important; width: auto !important; z-index: 3 !important;
  }
  html:root:root body.front.portal.front.portal header[data-r6-search-header="floating"][class][class] form.is-open .moviecms-search-field {
    display: flex !important;
  }
  html:root:root body.front.portal.front.portal header[data-r6-search-header="floating"][class][class] form.is-open input {
    display: block !important;
  }
  html:root:root body.front.portal.front.portal header[data-r6-search-header="floating"][class][class].is-search-open {
    height: auto !important; min-height: 96px !important; padding-bottom: 52px !important;
  }
}
/* At the narrow tablet breakpoint Keke is already a full-width search row. */
@media (min-width: 901px) and (max-width: 960px) {
  html:root:root body.front.portal.front.portal header[class][class][class] form[data-r6-collapsible="true"]:not(.is-open) {
    display: flex !important; position: static !important; width: 100% !important; grid-column: 1 / -1 !important;
  }
  html:root:root body.front.portal.front.portal header[class][class][class] form[data-r6-search="floating"] {
    display: flex !important; position: static !important; grid-column: 1 / -1 !important; grid-row: auto !important;
    width: 100% !important; min-width: 0 !important; max-width: none !important;
    height: 36px !important; min-height: 36px !important; border: 1px solid var(--r6-search-line) !important;
    border-radius: 18px !important; overflow: hidden !important; padding: 0 !important;
    background: var(--r6-search-surface) !important;
  }
  html:root:root body.front.portal.front.portal header[class][class][class] form[data-r6-search="floating"] .moviecms-search-field {
    display: contents !important;
  }
  html:root:root body.front.portal.front.portal header[class][class][class] form[data-r6-search="floating"] .moviecms-search-submit {
    display: none !important;
  }
  html:root:root body.front.portal.front.portal header[class][class][class] form[data-r6-search="floating"] > button {
    flex: 0 0 58px !important; width: 58px !important; min-width: 58px !important; max-width: 58px !important;
    height: 34px !important; min-height: 0 !important; border: 0 !important; border-radius: 0 !important;
    font-size: 14px !important; color: var(--r6-search-ink) !important; background: var(--r6-search-surface) !important;
    box-shadow: none !important;
  }
  html:root:root body.front.portal.front.portal header[class][class][class] form[data-r6-search="floating"] > button::before,
  html:root:root body.front.portal.front.portal header[class][class][class] form[data-r6-search="floating"] > button::after {
    display: none !important; content: none !important;
  }
}
/* Same side-by-side search-result geometry as the isolated OLE reference,
 * applied only to actual shared Keke search pages. No text/data/links removed. */
html:root body.front.portal.tpl-keke.search-page .keke-list > article {
  box-sizing: border-box !important; display: grid !important;
  grid-template-columns: clamp(118px,9vw,148px) minmax(0,1fr) !important;
  align-items: stretch !important; gap: 14px !important;
}
html:root body.front.portal.tpl-keke.search-page .keke-list > article > .keke-thumb {
  display: block !important; width: 100% !important; height: auto !important; min-height: 0 !important;
  aspect-ratio: 2 / 3 !important; align-self: start !important; overflow: hidden !important;
}
html:root body.front.portal.tpl-keke.search-page .keke-list > article > .keke-thumb :is(picture,img) {
  display: block !important; width: 100% !important; height: 100% !important;
  object-fit: cover !important; object-position: center !important;
}
html:root body.front.portal.tpl-keke.search-page .keke-list > article > div {
  box-sizing: border-box !important; display: grid !important; min-width: 0 !important; min-height: 0 !important;
  height: 100% !important; grid-template-rows: auto auto minmax(0,1fr) !important;
  align-content: start !important; gap: 7px !important; overflow: hidden !important;
}
html:root body.front.portal.tpl-keke.search-page .keke-list > article > div > :is(h2,h3,p) {
  min-width: 0 !important; margin: 0 !important; overflow: hidden !important;
  overflow-wrap: anywhere !important; word-break: break-word !important;
  display: -webkit-box !important; -webkit-box-orient: vertical !important; -webkit-line-clamp: 2 !important;
}
html:root body.front.portal.tpl-keke.search-page .keke-list > article > div > p:last-of-type { -webkit-line-clamp: 4 !important; }
@media (max-width: 900px) {
  html:root body.front.portal.tpl-keke.search-page .keke-list > article {
    grid-template-columns: clamp(104px,31vw,120px) minmax(0,1fr) !important;
    grid-template-rows: clamp(156px,46.5vw,180px) !important; gap: 10px !important; padding: 10px !important;
  }
  html:root body.front.portal.tpl-keke.search-page .keke-list > article > .keke-thumb { height: 100% !important; }
  html:root body.front.portal.tpl-keke.search-page .keke-list > article > div { gap: 5px !important; }
  html:root body.front.portal.tpl-keke.search-page .keke-list > article > div > p:last-of-type { -webkit-line-clamp: 3 !important; }
}
