/* AI search header launcher + command-palette overlay (M-06). */
.site-nav__search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #c6d4df;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 3px;
}
.site-nav__search:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}
.site-nav__search-label {
  font-size: 14px;
  font-weight: 500;
}

/* Click-opened, persistent overlay (not hover; stays until Esc/×/outside). */
.ai-launch {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
}
.ai-launch.is-open {
  display: block;
}
.ai-launch__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.ai-launch__panel {
  position: relative;
  max-width: 560px;
  margin: 12vh auto 0;
  background: #1b2838;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  padding: 16px;
}
.ai-launch__row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-launch__icon {
  color: #556772;
}
.ai-launch__input {
  flex: 1;
  min-width: 0;
  background: var(--color-deep-dark);
  color: #c6d4df;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  padding: 10px 12px;
  font-size: 15px;
}
.ai-launch__input::placeholder {
  color: #556772;
}
.ai-launch__input:focus {
  outline: none;
  border-color: var(--color-steam-blue);
  box-shadow: 0 0 0 2px rgba(102, 192, 244, 0.2);
}
.ai-launch__close {
  background: none;
  border: none;
  color: #8f98a0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.ai-launch__close:hover {
  color: #ffffff;
}
/* Filter radios (AI mode only), own row below the input. Kept compact so the
   five options sit on one line without looking spread out. Hidden in normal
   mode via the `hidden` attribute (see the .ai-launch [hidden] rule above). */
.ai-launch__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 10px;
  /* Indent to line up roughly with the input text (search icon + row gap). */
  padding-left: 26px;
  color: #c6d4df;
  font-size: 12px;
}
.ai-launch__filters label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}
.ai-launch__filters input[type="radio"] {
  margin: 0;
}
/* Submit sits at the right of the input row.
   Colours come from tokens rather than literals: the design overlay
   remaps --color-steam-blue, so this button follows the active accent instead
   of staying Steam blue while the rest of the UI changed hue. */
.ai-launch__submit {
  flex: 0 0 auto;
  background: var(--color-steam-blue);
  color: var(--color-deep-dark);
  border: none;
  border-radius: 3px;
  padding: 8px 18px;
  font-weight: 700;
  cursor: pointer;
}
.ai-launch__submit:hover {
  background: var(--color-steam-blue-bright);
}

@media (max-width: 640px) {
  .ai-launch__panel {
    margin-top: 8vh;
  }
}

/* ─── 通常/AI toggle + mode areas. Functional styling; visual tuning
   is deferred (view pass). ─────────────────────────────────────────────── */
/* Make the `hidden` attribute (toggled by JS for mode switching) win over the
   component `display` rules below. Without this, e.g. `.ai-launch__filters
   {display:flex}` and `.search-suggest {display:inline-block}` (author styles)
   override the UA `[hidden]{display:none}` and leave mode-scoped areas visible
   in the wrong mode. */
.ai-launch [hidden] {
  display: none !important;
}
/* Top bar: toggle with the AI daily count right beside it (left-aligned). */
.ai-launch__topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
}
/* Tokens rather than literals, same reason as the submit button above.
   The selected state follows the pattern the design overlay uses for the active
   pagination item — accent fill with dark text, for legibility on a bright hue. */
.ai-launch__toggle {
  display: inline-flex;
  gap: 2px;
  background: var(--color-deep-dark);
  border: 1px solid var(--color-border-subtle);
  border-radius: 4px;
  padding: 2px;
}
.ai-launch__toggle-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  padding: 6px 16px;
  border-radius: 3px;
  font-weight: 600;
  cursor: pointer;
}
.ai-launch__toggle-btn:hover:not([aria-pressed="true"]) {
  color: var(--color-text-light);
}
.ai-launch__toggle-btn[aria-pressed="true"] {
  background: var(--color-steam-blue);
  color: var(--color-deep-dark);
}

/* Normal-mode suggest dropdown: flow inside the modal (not an absolute overlay
   like the in-page search boxes). */
.ai-launch__suggest {
  position: relative;
  /* The element also carries `.search-suggest` (display:inline-block), which
     would shrink the dropdown to its content width — force full width. No
     margin here: when empty it must add no height, so the modal's bottom
     spacing matches AI mode (where this area is hidden). */
  display: block;
  width: 100%;
}
/* Flow inside the modal and span the full panel width (the in-page variant is
   an absolute overlay with a 360px min-width — reset both here). The gap lives
   on the dropdown so it only shows when the dropdown is actually open. */
.ai-launch__suggest .search-suggest__dropdown {
  position: static;
  min-width: 0;
  width: 100%;
  margin-top: 8px;
  max-height: 320px;
  overflow-y: auto;
}

/* Suggest loading indicator (spinner in the dropdown area while fetching). */
.ai-launch__suggest-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ai-launch__spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--color-steam-blue);
  border-radius: 50%;
  animation: ai-launch-spin 0.7s linear infinite;
}
@keyframes ai-launch-spin {
  to {
    transform: rotate(360deg);
  }
}

.ai-launch__count {
  margin: 0;
  color: #8f98a0;
  font-size: 12px;
  white-space: nowrap;
}
.ai-launch__count.is-reached {
  color: #e07a7a;
}
