/* 顶栏全站搜索（shared/global-search.js，2026-10-01）：标题和右上角按钮中间那块空地；下拉按板块分组 */
/* 右上角那串按钮很宽（管理员还有「以谁的身份看」，1440 宽的屏上只剩一百来像素）：框平时可以缩得很窄、不把右边挤到第二行；
   点进去打字时输入框往右盖出去（不占位置、不挤别的按钮），下拉自己保持够宽 */
.gs { position: relative; flex: 1 1 120px; max-width: 560px; min-width: 120px; margin: 0 10px; }   /* 基础宽度要小：换不换行按它算，有空地再长到 560 */
.gs:focus-within { z-index: 61; }
#gs:focus-within #gs-q { width: max(100%, 380px); max-width: calc(100vw - 260px); }
/* 要显眼（老板 10-01：「稍微显眼一点，让大家有意识去那里搜」）：绿边 + 一圈浅绿光、绿色放大镜。
   用 #gs #gs-q 压过外壳的通用输入框样式（ui-polish.css 的 :is(.main-content…) input 权重一样、又排在后面，圆角和左边留给图标的空都被它盖掉过） */
.gs::before { content: '⌕'; position: absolute; left: 13px; top: 50%; transform: translateY(-54%); z-index: 1; color: var(--accent); font-size: 19px; font-weight: 700; pointer-events: none; }
#gs #gs-q { display: block; width: 100%; height: 38px; min-height: 0; margin: 0; box-sizing: border-box; padding: 0 14px 0 36px;
  border: 1.5px solid var(--accent); border-radius: 999px; background: var(--surface); color: var(--text-primary);
  font: inherit; font-size: 14px; box-shadow: 0 0 0 3px var(--accent-soft-bg); }
#gs #gs-q::placeholder { color: var(--text-secondary); opacity: 1; }
#gs #gs-q:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-soft-bg), var(--shadow-2); }
#gs #gs-q::-webkit-search-cancel-button { cursor: pointer; }
.gs-kbd { display: none; }
.gs-drop { position: absolute; left: 0; width: max(100%, 520px); max-width: calc(100vw - 24px); top: calc(100% + 6px); z-index: 60; max-height: min(72vh, 640px); overflow: auto; padding: 4px 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-2); }
.gs-drop[hidden] { display: none; }
.gs-g + .gs-g { border-top: 1px solid var(--border-subtle); }
.gs-gh { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 14px 3px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.gs-more { font-weight: 500; color: var(--accent); text-decoration: none; }
.gs-more:hover { text-decoration: underline; }
.gs-it { display: flex; align-items: center; gap: 10px; padding: 6px 14px; min-height: 30px; color: var(--text-primary); text-decoration: none; font-size: 13px; }
.gs-it img { flex: none; width: 28px; height: 28px; object-fit: contain; border-radius: 5px; background: var(--surface-sunken); }
.gs-it .t { flex: 0 1 auto; max-width: 48%; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-it .s { flex: 1 1 auto; min-width: 0; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-it:hover, .gs-it.on { background: var(--surface-hover); }
/* 条目后面的小按钮（2026-10-02 老板：搜 PI / 编码 / 单号直接到干活的那一页，shared/global-search.js actsHtml）：
   条目和小按钮并排在一行 .gs-row 里（链接不能套链接），整行一起变色；停在小按钮上（←→）时那颗填满主色 */
.gs-row { display: flex; align-items: center; }
.gs-row > .gs-it { flex: 1 1 auto; min-width: 0; }
.gs-row:hover { background: var(--surface-hover); }
.gs-row:has(> .gs-it.on) { background: var(--surface-hover); }   /* 单独一条：不认 :has 的浏览器只丢这一条，条目自己照样亮 */
.gs-acts { flex: 0 1 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 62%; padding: 4px 12px 4px 0; }
.gs-act { flex: none; padding: 1px 8px; border: 1px solid var(--accent-soft-border); border-radius: var(--radius-full);
  background: var(--accent-soft-bg); color: var(--accent); font-size: 12px; line-height: 18px; white-space: nowrap; text-decoration: none; }
.gs-act:hover, .gs-act.on { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
.gs-foot, .gs-empty { padding: 8px 14px; font-size: 12px; color: var(--text-muted); }
.gs-empty { font-size: 13px; }
.gs-share { display: block; margin: 0 0 6px; padding: 3px 10px; border: 1px solid var(--accent-soft-border); border-radius: var(--radius-full);
  background: var(--accent-soft-bg); color: var(--accent); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.gs-share:hover { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
/* 给搜索框让位（老板 10-01：「复制链接用得不多」「真实发送中 / 数据服务在线这两个有什么用」）：
   两个状态灯平时只留小圆点，鼠标停上去看字（shared/global-search.js 写进 title）；
   「演练中 · 不外发」是要人注意的状态，照旧写字。「复制链接」只留图标（悬停照样有说明）。 */
.topbar-right .api-state:not(.send-mode) { font-size: 0; gap: 0; cursor: help; }
.topbar-right .send-mode.live { gap: 0; }
.topbar-right .send-mode.live span { display: none; }
.topbar-right .share-link-btn b { display: none; }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; }
  .gs { order: 3; flex: 1 1 100%; max-width: none; margin: 6px 0 0; }
  .gs-drop { width: 100%; }
  .gs-row { flex-wrap: wrap; }                        /* 手机上一行放不下：小按钮挪到条目下面一行，手指好点 */
  .gs-row > .gs-it { flex-basis: 100%; }
  .gs-acts { max-width: none; justify-content: flex-start; gap: 6px; padding: 0 14px 8px; }
  .gs-act { padding: 3px 10px; font-size: 13px; }
  #gs:focus-within #gs-q { width: 100%; max-width: none; }   /* 手机上本来就一整行 */
  #gs #gs-q { font-size: 16px; }                      /* iPhone 上小于 16px 一点进去就整页放大 */
  .gs-kbd { display: none; }
}
@media print { .gs { display: none; } }
