.yp-global-search { position:relative; width:100%; min-width:0; margin:0; z-index:110; }
.yp-global-search-field { display:flex; align-items:center; height:40px; gap:10px; padding:0 12px; border:1px solid #dfe3e8; border-radius:8px; background:var(--card,#fff); }
.yp-global-search-field svg { width:18px; height:18px; flex-shrink:0; color:#8b97a7; }
.yp-global-search-field input { width:100%; min-width:0; height:100%; border:0; outline:none; box-shadow:none; background:transparent; color:var(--text,#303640); font-size:13px; font-family:inherit; }
.yp-global-search-field input::placeholder { color:#98a2b1; }
.yp-global-search-field button { flex-shrink:0; border:0; padding:0; background:transparent; color:#c7353b; font-size:13px; font-weight:600; cursor:pointer; }
.yp-global-search-results { position:absolute; top:calc(100% + 7px); left:0; right:0; max-height:360px; overflow:auto; padding:10px; background:var(--card,#fff); border:1px solid var(--line,#e5e7eb); border-radius:10px; box-shadow:0 14px 36px #25253024; color:var(--muted,#737985); font-size:13px; }
.yp-global-search-results[hidden] { display:none !important; }
.yp-global-search-results button { display:flex; width:100%; align-items:center; gap:10px; padding:11px 9px; border:0; border-radius:5px; color:var(--text,#303640); background:transparent; cursor:pointer; text-align:left; }
.yp-global-search-results button:hover,.yp-global-search-results button[aria-selected=true] { background:var(--blue-soft,#fff0f0); }
.yp-global-search-results button span { color:var(--muted,#8b97a7); font-size:12px; }
.yp-global-search-results button small { margin-left:auto; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted,#8b97a7); font-size:11px; }
@media(min-width:1025px) {
 html body .main-area > .topbar.yp-has-stock-search:not(.yp-topbar-collapsed), html body > .topbar.yp-has-stock-search:not(.yp-topbar-collapsed) {
  display:grid !important; grid-template-columns:minmax(110px,1fr) minmax(240px,520px) max-content;
  align-items:center; gap:18px; position:sticky; top:0; z-index:220; overflow:visible;
 }
 html body .topbar.yp-has-stock-search > nav { justify-self:end; width:max-content; min-width:max-content; margin:0; }
}
@media(min-width:1025px) and (max-width:1500px) {
 html body .main-area > .topbar.yp-has-stock-search:not(.yp-topbar-collapsed), html body > .topbar.yp-has-stock-search:not(.yp-topbar-collapsed) { grid-template-columns:minmax(100px,1fr) minmax(220px,440px) max-content; gap:12px; }
 html body .topbar.yp-has-stock-search .topbar-primary a span, html body .topbar.yp-has-stock-search .topbar-primary a small { display:none; }
}
@media(max-width:1024px) {
 .yp-global-search { width:clamp(150px,42vw,340px); flex:1; margin:0 8px; }
 .yp-global-search-field { height:32px; padding:0 7px; gap:5px; }
 .yp-global-search-field input { font-size:12px; }
 .yp-global-search-field button { font-size:11px; }
 .yp-global-search-results { position:fixed; left:12px; right:12px; top:60px; max-height:50vh; }
}
html body .yp-global-search input:focus, html body .yp-global-search input:focus-visible { outline:none !important; box-shadow:none !important; background:transparent !important; }
@media(max-width:1024px) {
 .yp-global-search { min-width:150px; flex-shrink:0; }
 .yp-global-search-field input { padding:0; }
}

/* Shared market clock replaces the module title in the application header. */
html body :is(.topbar,.wb-topbar) .yp-market-clock { display:flex; flex-direction:column; justify-content:center; align-items:flex-start; gap:2px; min-width:0; color:var(--muted,#737985); font-size:12px; line-height:1.35; white-space:nowrap; }
html body :is(.topbar,.wb-topbar) .yp-market-clock-status { display:flex; align-items:center; gap:10px; }
html body :is(.topbar,.wb-topbar) #wbBeijingTime { font-size:13px; font-weight:650; font-variant-numeric:tabular-nums; color:var(--text,#303640); }
html body :is(.topbar,.wb-topbar) #wbTradingDay { display:inline-flex; align-items:center; gap:5px; font-size:11px; }
html body :is(.topbar,.wb-topbar) #wbTradingDay::before { content:""; width:5px; height:5px; border-radius:50%; background:currentColor; }
html body :is(.topbar,.wb-topbar) #wbTradingDay[data-status="open"] { color:#d92d32; }
@media(min-width:1025px) {
 html body .main-area > .topbar.yp-has-stock-search:not(.yp-topbar-collapsed),
 html body > .topbar.yp-has-stock-search:not(.yp-topbar-collapsed),
 #workspaceHome .main-area > .topbar.yp-has-stock-search:not(.yp-topbar-collapsed) { grid-template-columns:minmax(max-content,1fr) minmax(180px,520px) max-content; }
}
@media(max-width:1024px) {
 html body :is(.topbar,.wb-topbar) .yp-market-clock { font-size:10px; }
 html body :is(.topbar,.wb-topbar) #wbBeijingTime { font-size:11px; }
}

.wb-topbar .yp-market-clock { flex-shrink:0; }
@media(max-width:600px) { .wb-topbar:has(.yp-market-clock) { flex-wrap:wrap; padding-block:5px; } }

/* 日期/时间和星期/交易状态分列，交易状态居中对齐星期。 */
html body :is(.topbar,.wb-topbar) .yp-market-clock { display:grid; grid-template-columns:auto auto; align-items:center; justify-content:start; column-gap:12px; row-gap:2px; }
html body :is(.topbar,.wb-topbar) :is(.yp-market-date,.yp-market-clock-status) { display:contents; }
html body :is(.topbar,.wb-topbar) .yp-market-weekday,
html body :is(.topbar,.wb-topbar) #wbTradingDay { justify-self:center; }


/* Desktop clock stays on one line; narrow screens retain the compact two-row layout. */
@media(min-width:1025px) {
 html body :is(.topbar,.wb-topbar) .yp-market-clock { grid-template-columns:repeat(4,max-content); column-gap:12px; row-gap:0; }
}

/* Larger desktop header labels and navigation icons without increasing bar height. */
@media(min-width:1025px) {
 html body :is(.topbar,.wb-topbar) .yp-market-clock { font-size:14px; }
 html body :is(.topbar,.wb-topbar) #wbBeijingTime { font-size:15px; }
 html body :is(.topbar,.wb-topbar) #wbTradingDay { font-size:13px; }
 html body.yp-desktop-unified .topbar .topbar-primary > a,
 #workspaceHome .topbar .topbar-primary > a { font-size:14px !important; }
 html body.yp-desktop-unified .topbar .topbar-line-icon,
 #workspaceHome .topbar .topbar-line-icon { width:18px !important; height:18px !important; }
}

.yp-global-search-results .yp-search-section-title { padding:8px 9px; font-weight:600; color:var(--text,#303640); }
.yp-global-search-results p { margin:0; padding:8px 9px 12px; }

/* Compact desktop search popover; standalone/mobile search keeps touch spacing. */
@media (min-width:1025px) {
  html body .wh-stock-search-dropdown { padding:8px; }
  #stockSearchDropdown .stock-search-history { margin-bottom:6px; padding:0 10px 8px; border-radius:7px; box-shadow:none; }
  #stockSearchDropdown .stock-search-history:has(.stock-history-list[hidden]) { padding-bottom:0; }
  #stockSearchDropdown .stock-search-history > header { min-height:36px; }
  #stockSearchDropdown .stock-search-history h2 { font-size:13px; }
  #stockSearchDropdown .stock-search-hot { display:grid; grid-template-columns:auto minmax(0,1fr); border-radius:7px; box-shadow:none; }
  #stockSearchDropdown .stock-search-hot > header { min-height:40px; padding:0 10px; border-bottom:0; }
  #stockSearchDropdown .stock-search-hot :is(h1,h2) { font-size:13px; white-space:nowrap; }
  #stockSearchDropdown .stock-search-platform-tabs { justify-content:flex-end; align-items:center; gap:4px; padding:6px 10px 6px 0; }
  #stockSearchDropdown .stock-search-platform-tabs > button { min-height:28px; padding:3px 9px; font-size:11px; }
  #stockSearchDropdown .stock-search-hot-list { grid-column:1 / -1; padding:0 10px; border-top:1px solid #edf1f5; }
  #stockSearchDropdown .stock-search-row { min-height:60px; grid-template-columns:20px minmax(0,1fr) 74px 70px; grid-template-rows:auto auto; gap:3px 8px; padding:7px 0; }
  #stockSearchDropdown .stock-search-rank { grid-column:1; grid-row:1 / 3; }
  #stockSearchDropdown .stock-search-stock { grid-column:2; grid-row:1; padding:0; }
  #stockSearchDropdown .stock-search-quote { grid-column:3; grid-row:1 / 3; padding:0; }
  #stockSearchDropdown .stock-search-actions { grid-column:4; grid-row:1 / 3; grid-template-columns:32px 32px; align-self:center; gap:6px; }
  #stockSearchDropdown .stock-search-platform-ranks { grid-column:2; grid-row:2; flex-wrap:wrap; gap:3px; overflow:visible; }
  #stockSearchDropdown .stock-search-platform-ranks > span { min-height:19px; padding:2px 4px; border-radius:4px; font-size:9px; }
  #stockSearchDropdown .stock-search-hot-sentinel { grid-column:1 / -1; min-height:28px; padding:7px; }
  #stockSearchDropdown .stock-search-state { padding:20px 10px; }
}

/* The same embedded search component is used by every site header. */
html body .topbar .wh-stock-search { display:block; position:relative; z-index:110; min-width:0; width:100%; margin:0; }
html body .topbar .wh-stock-search .stock-search-form { display:flex; align-items:center; height:36px; padding:0 12px 0 0; border:1px solid #e5e7eb; border-radius:8px; background:#fff; }
html body .topbar #stockSearchInput { width:100%; min-width:0; height:34px; border:0; background:transparent; box-shadow:none; font-size:13px; }
html body .topbar .wh-stock-search .ab-stock { flex:1; min-width:0; }
html body .topbar .wh-stock-search .stock-search-form > button { color:#c7353b; font-size:13px; }
html body .topbar .wh-stock-search-dropdown { position:absolute; top:calc(100% + 6px); left:50%; transform:translateX(-50%); width:min(680px,calc(100vw - 32px)); max-height:min(560px,65vh); overflow:auto; overscroll-behavior:contain; padding:8px; border:1px solid #e5e7eb; border-radius:10px; background:#fff; box-shadow:0 14px 36px #25253024; }
html body .topbar .wh-stock-search-dropdown[hidden],html body .topbar .stock-history-list[hidden] { display:none; }
html body .topbar .wh-stock-search:not(.is-open) .ac-panel { display:none; }
html body .topbar .wh-stock-search .ac-panel { z-index:2; width:100%; right:auto; }
html body .topbar .wh-stock-search .wb-up { color:#e33e49; }
html body .topbar .wh-stock-search .wb-down { color:#12a164; }
@media(max-width:1024px) {
 html body .topbar .wh-stock-search { width:clamp(150px,42vw,340px); min-width:150px; flex:1 0 150px; margin:0 8px; }
 html body .topbar .wh-stock-search-dropdown { position:fixed; left:12px; right:12px; top:60px; transform:none; width:auto; max-height:65vh; }
}
