/*
 * Origin Kudada 产品手册 - 顶部工具
 * ------------------------------------------------------------
 * 只维护顶部“内容搜索 / 亮暗模式”按钮与搜索弹窗外观。
 * DOM 结构在 assets/js/ui.js；主题逻辑在 theme.js；搜索逻辑在 search.js。
 */

/* 关闭 MkDocs 自带的搜索和主题按钮，避免出现两套入口。 */
.md-header__option[data-md-component="palette"],
.md-header__button[for="__search"] {
  display: none !important;
}


/* ==================== 左上角站点名称 ====================
 * 名称内容由 ui.js 注入，避免在模板文件中硬编码。
 */
.ok-site-brand-name,
.ok-site-brand-manual {
  display: block;
  line-height: 1.25;
}
.ok-site-brand-name {
  /* 仅放大文字，不修改 .md-header__title 的宽度。 */
  font-size: .98rem;
  font-weight: 800;
}
.ok-site-brand-manual {
  margin-top: .08rem;
  font-size: .80rem;
  font-weight: 800;
  line-height: 1.2;
}

/* ==================== 顶部按钮 ==================== */
.ok-header-tools {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-left: auto;
}

.ok-header-action {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  height: 2rem;
  padding: 0 .58rem;
  border: 0;
  border-radius: var(--ok-radius-sm);
  background: transparent;
  color: var(--ok-header-text);
  font: inherit;
  font-size: .64rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, opacity .15s ease;
}

.ok-header-action:hover {
  background: var(--ok-header-bg-hover);
}

.ok-header-action svg {
  width: 1.02rem;
  height: 1.02rem;
  fill: currentColor;
  flex: none;
}

.ok-theme-sun { display: none; }
.ok-theme-moon { display: block; }
body[data-md-color-scheme="slate"] .ok-theme-sun { display: block; }
body[data-md-color-scheme="slate"] .ok-theme-moon { display: none; }

/* ==================== 搜索弹窗 ==================== */
.ok-search-panel[hidden] { display: none !important; }
.ok-search-panel {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5.1rem 1rem 1rem;
}

.ok-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 22, .48);
  backdrop-filter: blur(2px);
}

.ok-search-card {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 7rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--ok-border);
  border-radius: var(--ok-radius-lg);
  background: var(--ok-card-bg);
  box-shadow: var(--ok-shadow-panel);
}

.ok-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem .7rem;
}

.ok-search-title strong,
.ok-search-title small { display: block; }
.ok-search-title strong { color: var(--ok-text-strong); font-size: .86rem; }
.ok-search-title small { margin-top: .12rem; color: var(--ok-text-muted); font-size: .59rem; }

.ok-search-close {
  width: 1.8rem;
  height: 1.8rem;
  border: 0;
  border-radius: 999px;
  background: var(--ok-code-bg);
  color: var(--ok-text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.ok-search-box {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: 0 1rem;
  padding: .6rem .72rem;
  border: 1px solid var(--ok-border);
  border-radius: .62rem;
  background: var(--ok-code-bg);
}

.ok-search-box:focus-within {
  border-color: var(--ok-link);
  box-shadow: 0 0 0 2px var(--ok-info-soft-strong);
}

.ok-search-box svg { width: 1rem; height: 1rem; fill: var(--ok-text-muted); }
.ok-search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ok-text);
  font: inherit;
  font-size: .72rem;
}
.ok-search-box input::placeholder { color: var(--ok-text-muted); }

.ok-search-meta {
  padding: .62rem 1.05rem .45rem;
  color: var(--ok-text-muted);
  font-size: .58rem;
}

.ok-search-results { overflow: auto; padding: 0 .72rem .85rem; }
.ok-search-result {
  display: block;
  margin: .25rem 0;
  padding: .72rem .8rem;
  border: 1px solid transparent;
  border-radius: .58rem;
  color: var(--ok-text) !important;
  text-decoration: none !important;
  background: transparent;
}
.ok-search-result:hover {
  border-color: var(--ok-info-border);
  background: var(--ok-info-soft);
}
.ok-search-result strong { display: block; margin-bottom: .18rem; color: var(--ok-text-strong); font-size: .69rem; }
.ok-search-result span { display: block; color: var(--ok-text-muted); font-size: .59rem; line-height: 1.55; }
.ok-search-empty { padding: 1rem .8rem; color: var(--ok-text-muted); font-size: .65rem; text-align: center; }
body.ok-search-open { overflow: hidden; }
