/* ── Spotlight 浮层样式 ──
   视觉基准：spotlight-demo-20260323-v2.html
   所有 class 使用 mkl- 前缀 */

.mkl-spotlight-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.45); z-index: 9998;
  opacity: 0; visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms ease;
}
.mkl-spotlight-overlay.is-active { opacity: 1; visibility: visible; }

.mkl-spotlight {
  position: fixed; top: 140px; left: 50%;
  transform: translateX(-50%) scale(0.97);
  width: 640px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 200px);
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.18), 0 2px 12px rgba(0,0,0,0.08);
  z-index: 9999;
  opacity: 0; visibility: hidden;
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
  display: flex; flex-direction: column; overflow: hidden;
}
.mkl-spotlight.is-active { opacity: 1; visibility: visible; transform: translateX(-50%) scale(1); }

/* ── Input ── */
.mkl-spotlight-input-wrap {
  display: flex; align-items: center; padding: 14px 18px;
  border-bottom: 0.5px solid #E5E5EA; gap: 10px; flex-shrink: 0;
}
.mkl-spotlight-input-wrap > svg { width: 18px; height: 18px; color: #86868B; flex-shrink: 0; }
.mkl-spotlight-input {
  flex: 1; border: none; outline: none; font-size: 16px;
  font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: transparent; color: #1D1D1F; line-height: 1.4;
}
.mkl-spotlight-input::placeholder { color: #86868B; }
.mkl-spotlight-clear {
  width: 20px; height: 20px; border-radius: 50%; background: #C7C7CC;
  border: none; cursor: pointer; display: none; align-items: center; justify-content: center;
  flex-shrink: 0; padding: 0; transition: background 180ms ease;
}
.mkl-spotlight-clear:hover { background: #A1A1A6; }
.mkl-spotlight-clear svg { width: 10px; height: 10px; color: #fff; }
.mkl-spotlight-clear.is-visible { display: flex; }

/* ── Results ── */
.mkl-spotlight-results {
  overflow-y: auto; overscroll-behavior: contain; flex: 1; padding: 4px 0;
}
.mkl-spotlight-results::-webkit-scrollbar { width: 6px; }
.mkl-spotlight-results::-webkit-scrollbar-track { background: transparent; }
.mkl-spotlight-results::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }

/* ── Section ── */
.mkl-spotlight-section { padding: 4px 0; }
.mkl-spotlight-section + .mkl-spotlight-section { border-top: 0.5px solid #E5E5EA; }
.mkl-spotlight-section-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.4px;
  text-transform: uppercase; color: #86868B; padding: 8px 18px 4px;
}

/* ── Item ── */
.mkl-spotlight-item {
  display: flex; align-items: center; padding: 8px 18px;
  cursor: pointer; transition: background 80ms ease;
  text-decoration: none; color: inherit; gap: 12px; position: relative;
}
.mkl-spotlight-item:hover,
.mkl-spotlight-item.is-focused { background: #F5F5F7; }
.mkl-spotlight-item.is-focused {
  background: #0071e3; color: #fff;
  border-radius: 8px; margin: 0 6px; padding-left: 12px; padding-right: 12px;
}
.mkl-spotlight-item.is-focused .mkl-spotlight-item-sub,
.mkl-spotlight-item.is-focused .mkl-spotlight-item-meta { color: rgba(255,255,255,0.72); }
.mkl-spotlight-item.is-focused mark { background: rgba(255,255,255,0.2); color: #fff; }
.mkl-spotlight-item.is-focused .mkl-spotlight-item-arrow { color: rgba(255,255,255,0.5); }

/* ── Icon / Thumbnail ── */
.mkl-spotlight-item-icon {
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.mkl-spotlight-item-icon--placeholder { background: #F5F5F7; }
.mkl-spotlight-item-icon--placeholder.is-industrial { background: rgba(0, 113, 227, 0.07); }
.mkl-spotlight-item-icon--placeholder.is-consumer { background: rgba(88, 86, 214, 0.07); }
.mkl-spotlight-item-icon--placeholder svg { width: 18px; height: 18px; }
.mkl-spotlight-item-icon--placeholder.is-industrial svg { color: #0071e3; opacity: 0.5; }
.mkl-spotlight-item-icon--placeholder.is-consumer svg { color: #5856D6; opacity: 0.5; }
.mkl-spotlight-item-icon--thumb { background: #F5F5F7; }
.mkl-spotlight-item-icon--thumb img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.mkl-spotlight-item.is-focused .mkl-spotlight-item-icon--placeholder { background: rgba(255,255,255,0.15); }
.mkl-spotlight-item.is-focused .mkl-spotlight-item-icon--placeholder svg { color: rgba(255,255,255,0.7); opacity: 1; }
.mkl-spotlight-item.is-focused .mkl-spotlight-item-icon--thumb { background: rgba(255,255,255,0.92); }
.mkl-spotlight-item-icon--generic { background: #F5F5F7; }
.mkl-spotlight-item-icon--generic svg { width: 18px; height: 18px; color: #86868B; }
.mkl-spotlight-item.is-focused .mkl-spotlight-item-icon--generic { background: rgba(255,255,255,0.15); }
.mkl-spotlight-item.is-focused .mkl-spotlight-item-icon--generic svg { color: rgba(255,255,255,0.8); }

/* ── Text ── */
.mkl-spotlight-item-text { flex: 1; min-width: 0; }
.mkl-spotlight-item-title {
  font-size: 14px; font-weight: 500; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mkl-spotlight-item-sub {
  font-size: 12px; color: #86868B; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}

/* ── OS Tags ── */
.mkl-os-tags { display: inline-flex; gap: 4px; margin-left: 4px; }
.mkl-os-tag {
  display: inline-block; font-size: 10px; font-weight: 500;
  padding: 1px 5px; border-radius: 3px;
  background: rgba(0,0,0,0.05); color: #6E6E73; line-height: 1.4; letter-spacing: 0.2px;
}
.mkl-spotlight-item.is-focused .mkl-os-tag { background: rgba(255,255,255,0.2); color: rgba(255,255,255,0.85); }

/* ── Arrow ── */
.mkl-spotlight-item-arrow {
  color: #86868B; flex-shrink: 0; opacity: 0; transition: opacity 80ms ease;
}
.mkl-spotlight-item:hover .mkl-spotlight-item-arrow,
.mkl-spotlight-item.is-focused .mkl-spotlight-item-arrow { opacity: 1; }

/* ── Line dot ── */
.mkl-line-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.mkl-line-dot--industrial { background: #0071e3; }
.mkl-line-dot--consumer { background: #5856D6; }

/* ── View All ── */
.mkl-spotlight-viewall {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; cursor: pointer; transition: background 80ms ease;
  border-top: 0.5px solid #E5E5EA; color: #0071e3; font-size: 13px; font-weight: 500;
}
.mkl-spotlight-viewall:hover,
.mkl-spotlight-viewall.is-focused { background: #F5F5F7; }
.mkl-spotlight-viewall.is-focused {
  background: #0071e3; color: #fff;
  border-radius: 8px; margin: 0 6px 4px; padding-left: 12px; padding-right: 12px; border-top: none;
}
.mkl-spotlight-viewall-count { font-weight: 400; opacity: 0.7; }

/* ── Empty / Prompt ── */
.mkl-spotlight-empty { padding: 40px 18px; text-align: center; }
.mkl-spotlight-empty-icon { width: 40px; height: 40px; margin: 0 auto 12px; color: #86868B; opacity: 0.5; }
.mkl-spotlight-empty-text { font-size: 14px; color: #86868B; }
.mkl-spotlight-empty-hint { font-size: 12px; color: #A1A1A6; margin-top: 4px; }
.mkl-spotlight-prompt { padding: 32px 18px; text-align: center; }
.mkl-spotlight-prompt-text { font-size: 13px; color: #86868B; }

/* ── Highlight ── */
.mkl-spotlight-results mark {
  background: rgba(0, 113, 227, 0.10); color: #0071e3;
  border-radius: 2px; padding: 0 1px; font-weight: 500;
}
.mkl-spotlight-item.is-focused mark { background: rgba(255,255,255,0.2); color: #fff; }
