/* ================================================================
   1. COMMAND PALETTE & SPOTLIGHT QUICK SEARCH (Ctrl + K)
   ================================================================ */
.spotlight-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 16px 20px;
  animation: spotlightFadeIn 0.18s ease-out;
}
.spotlight-overlay[hidden],
.spotlight-overlay.hidden {
  display: none !important;
}

.spotlight-modal {
  width: min(640px, 100%);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  animation: spotlightSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.spotlight-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1.5px solid #e2e8f0;
  background: #f8fafc;
}
.spotlight-search-icon {
  font-size: 20px;
  color: #64748b;
  flex-shrink: 0;
}
.spotlight-input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  color: #1e1b4b;
  outline: none;
}
.spotlight-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}
.spotlight-kbd {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 3px 6px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.spotlight-results {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  max-height: 460px;
}
.spotlight-category-header {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 12px 4px;
}

.spotlight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.12s ease;
  margin-bottom: 2px;
}
.spotlight-item:hover,
.spotlight-item.selected {
  background: #f1f5f9;
  transform: translateX(2px);
}
.spotlight-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.spotlight-hanzi {
  font-family: STKaiti, KaiTi, serif;
  font-size: 26px;
  font-weight: 700;
  color: #1e1b4b;
  line-height: 1;
  width: 44px;
  text-align: center;
  flex-shrink: 0;
}
.spotlight-info {
  min-width: 0;
}
.spotlight-pinyin {
  font-size: 14px;
  font-weight: 700;
  color: #6657d9;
}
.spotlight-meaning {
  font-size: 13px;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.spotlight-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #334155;
  white-space: nowrap;
  flex-shrink: 0;
}
.spotlight-badge.hsk1 { background: #eeebfa; color: #6657d9; }
.spotlight-badge.hsk2 { background: #dcfce7; color: #166534; }
.spotlight-badge.hsk3 { background: #e0f2fe; color: #0369a1; }
.spotlight-badge.tool { background: #fef3c7; color: #92400e; }

.spotlight-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.spotlight-action-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.spotlight-action-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #1e1b4b;
}

.spotlight-footer {
  padding: 10px 18px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: #64748b;
}
.spotlight-footer-keys {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Header Trigger Button */
.spotlight-header-btn {
  background: #f8fafc;
  color: #64748b;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.spotlight-header-btn:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e1b4b;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

@keyframes spotlightFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes spotlightSlideDown {
  from { transform: translateY(-16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

