/* ============================================================================
   站内「自由搜索」样式（右上角搜索框 + 结果浮层）
   逻辑见 js/guide-search.js，内容见 js/guide-kb.js。
   ----------------------------------------------------------------------------
   两条设计约束：
   1) 各页顶栏的背景不一样（有的纯白、有的是暖色渐变），所以搜索框走
      "半透明白底 + 极淡描边"，在两种底子上都读得清，不需要给每种顶栏单独调色。
   2) 结果浮层用 position:fixed + JS 算坐标，**不能**用 absolute：
      顶栏多数带 overflow 裁剪，绝对定位会被切掉一半。
   ========================================================================== */

/* 搜索框挂在顶栏右侧，但顶栏最右边还悬浮着「用户徽标」（#userchip，position:fixed），
   两者会叠在一起。所以这里给它留出徽标那块宽度：--gs-gap 由 js/guide-search.js
   量完徽标再写进来（各页顶栏内边距不同，所以要减掉顶栏自己的 padding-right）。 */
.gs-slot { margin-left: auto; margin-right: var(--gs-gap, 0px); display: flex; align-items: center; gap: 8px; padding-right: 2px; min-width: 0; }

/* 顶栏右侧的可用宽度 = tb-right 宽度 − 用户徽标占位（--gs-gap）。
   平板宽度（~1024）上这块只剩 150px 左右：早先输入框写死 176px，整个搜索框被挤到
   tb-right 左侧之外，压在页面标题上（hover 变白底时直接把标题盖住）。
   所以盒子和输入框都允许收缩，窄屏再收起 ⌘K 提示（2026-10-28 学生反馈）。 */
.gs-box {
  display: flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px 0 11px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .74);
  border: 1px solid rgba(20, 40, 50, .12);
  box-shadow: 0 1px 2px rgba(15, 25, 35, .05);
  transition: background .15s, border-color .15s, box-shadow .15s;
  min-width: 0; max-width: 100%;
}
.gs-box:hover { background: #fff; border-color: rgba(12, 147, 166, .45); }
.gs-box.is-focus { background: #fff; border-color: #0C93A6; box-shadow: 0 0 0 3px rgba(12, 147, 166, .14); }
.gs-box svg { width: 15px; height: 15px; flex: none; stroke: #6B7280; fill: none; stroke-width: 2; stroke-linecap: round; }
.gs-input {
  border: 0; background: transparent; outline: none;
  width: 176px; min-width: 0; flex: 1 1 auto; font-size: 12.5px; color: #1F2937; font-family: inherit;
}
.gs-input::placeholder { color: #8A939B; }
.gs-kbd {
  font-size: 10.5px; color: #8A939B; border: 1px solid rgba(20, 40, 50, .16);
  border-radius: 4px; padding: 0 4px; line-height: 15px; white-space: nowrap;
}
/* 窄屏：先把 ⌘K 提示收掉，再按比例收输入框 —— 保证搜索框整体留在 tb-right 里，
   不越界压到页面标题。 */
@media (max-width: 1180px) { .gs-kbd { display: none; } }
@media (max-width: 1000px) { .gs-input { width: 72px; } }

/* ---------- 结果浮层 ---------- */
.gs-panel {
  position: fixed; z-index: 9600; width: 452px; max-height: 64vh; overflow: auto;
  background: #fff; border: 1px solid rgba(20, 40, 50, .08); border-radius: 13px;
  box-shadow: 0 20px 52px rgba(12, 25, 35, .24); padding: 7px;
  -webkit-overflow-scrolling: touch;
}
.gs-panel[hidden] { display: none; }
.gs-head {
  font-size: 11.5px; color: #8A939B; padding: 5px 8px 6px;
  display: flex; justify-content: space-between; gap: 8px;
}
.gs-item {
  padding: 9px 10px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent;
}
.gs-item + .gs-item { margin-top: 2px; }
.gs-item.is-active { background: #F1F7F8; border-color: #D6E9EC; }
.gs-titlerow { display: flex; align-items: center; gap: 7px; }
.gs-cat {
  font-size: 10.5px; padding: 1px 6px; border-radius: 5px; flex: none;
  background: #E8F4F6; color: #0A6E7D;
}
.gs-cat--flow { background: #EAF3EA; color: #3F6B3F; }
.gs-cat--fix { background: #FBF1E0; color: #8A5A00; }
.gs-cat--know { background: #F0EDF7; color: #5B4B8A; }
.gs-title { font-size: 13.5px; font-weight: 600; color: #1F2937; }
.gs-steps { font-size: 12px; color: #4B5563; line-height: 1.6; margin-top: 4px; }
.gs-steps div { display: flex; gap: 6px; }
.gs-steps b { color: #0C93A6; font-weight: 600; flex: none; }
.gs-meta { font-size: 11.5px; color: #0A6E7D; margin-top: 5px; }
.gs-meta span + span { margin-left: 10px; }
.gs-meta i { font-style: normal; color: #8A939B; }
.gs-go {
  margin-top: 7px; font-size: 12px; padding: 4px 11px; border-radius: 8px;
  border: 1px solid #0C93A6; color: #0A6E7D; background: #fff; cursor: pointer;
  font-family: inherit;
}
.gs-go:hover { background: #0C93A6; color: #fff; }

/* 空状态 / 兜底 */
.gs-empty { padding: 12px 11px; }
.gs-empty .gs-hint { font-size: 12.5px; color: #4B5563; line-height: 1.7; }
.gs-hot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.gs-hot button {
  font-size: 12px; padding: 3px 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid #DDE3E7; background: #FBFCFC; color: #3F4A55; font-family: inherit;
}
.gs-hot button:hover { border-color: #0C93A6; color: #0A6E7D; }
.gs-ask {
  margin: 4px 4px 2px; padding: 10px 11px; border-radius: 10px;
  background: #FDF6EA; border-left: 3px solid #B57400;
}
.gs-ask p { margin: 0 0 7px; font-size: 12.5px; color: #5C4A22; line-height: 1.65; }
.gs-ask button {
  font-size: 12.5px; padding: 5px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid #B57400; background: #fff; color: #8A5A00; font-family: inherit;
}
.gs-ask button:hover { background: #B57400; color: #fff; }
.gs-foot { font-size: 11px; color: #9AA3AB; padding: 7px 8px 3px; border-top: 1px solid #F0F3F5; margin-top: 5px; }

/* ---------- 跳转后的「就是这里」外轮廓（见 js/app.js 的 window.GuideMark） ----------
   "功能在哪 / 怎么操作"这类问题，光把人送到页面还不够：页面那么大，得让他一眼看见"就是这一块"。
   outline-offset 取负值：描边画在元素**内侧**，这样即使父层有 overflow 裁剪也不会被切掉。 */
.gs-spot {
  outline: 3px solid #0C93A6; outline-offset: -4px; border-radius: 18px;
  animation: gsSpotPulse 1.5s ease-in-out infinite;
}
@keyframes gsSpotPulse {
  0%, 100% { outline-color: rgba(12, 147, 166, .95); }
  50%      { outline-color: rgba(34, 184, 206, .26); }
}
.gs-spot-tag {
  position: fixed; z-index: 9601; pointer-events: none;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; color: #fff; white-space: nowrap;
  background: linear-gradient(135deg, #0C93A6, #22B8CE);
  box-shadow: 0 8px 20px rgba(12, 147, 166, .35);
  animation: gsTagIn .24s ease both;
}
@keyframes gsTagIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* 窄屏（平板竖屏 / 小窗）：只留放大镜，点开浮层再输入 */
@media (max-width: 860px) {
  .gs-input { width: 22px; }
  .gs-input::placeholder { color: transparent; }
  .gs-kbd { display: none; }
  .gs-panel { width: min(452px, calc(100vw - 20px)); }
}
