/* =============================================
   功能搜索 Spotlight 浮层
   ============================================= */

/* 搜索触发按钮（顶栏） */
.nav-search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    margin-right: 8px;
    font-family: inherit;
    white-space: nowrap;
}
.nav-search-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}
.nav-search-btn i { font-size: 15px; }
.nav-search-btn .search-hint-text {
    color: #94a3b8;
    font-size: 12px;
}
.nav-search-btn kbd {
    font-family: 'JetBrains Mono', monospace;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 10px;
    color: #94a3b8;
}

/* 遮罩层 */
.tool-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}
.tool-search-overlay.active {
    display: flex;
}

/* 搜索框主体 */
.tool-search-box {
    width: 580px;
    max-width: 92vw;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2), 0 0 0 1px rgba(0, 0, 0, .05);
    overflow: hidden;
    animation: tsSlideDown .2s ease;
}
@keyframes tsSlideDown {
    from { opacity: 0; transform: translateY(-16px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 输入区 */
.tool-search-input-wrap {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}
.tool-search-input-wrap > i {
    font-size: 20px;
    color: #94a3b8;
    flex-shrink: 0;
}
.tool-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: inherit;
    color: #1e293b;
    background: transparent;
    min-width: 0;
}
.tool-search-input::placeholder { color: #94a3b8; }
.tool-search-kbd {
    font-size: 11px;
    color: #94a3b8;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
}

/* 结果列表 */
.tool-search-results {
    max-height: 420px;
    overflow-y: auto;
    padding: 8px;
}
.tool-search-results::-webkit-scrollbar { width: 4px; }
.tool-search-results::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* 空状态 */
.tool-search-empty {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}
.tool-search-empty i {
    font-size: 36px;
    display: block;
    margin-bottom: 10px;
    opacity: .4;
}

/* 分类标题 */
.tool-search-category {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: .5px;
    padding: 10px 12px 4px;
    text-align: center;
}
.tool-search-category:first-child { padding-top: 4px; }

/* 结果项 */
.tool-search-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 12px;
    border-radius: 10px;
    color: #334155;
    text-decoration: none;
    cursor: pointer;
    transition: background .12s;
    text-align: center;
}
.tool-search-item:hover { background: #f8fafc; }
.tool-search-item.ts-active {
    background: linear-gradient(135deg, #ede9fe 0%, #e0f2fe 100%);
}

.tool-search-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 100%);
    color: #7c5cf8;
    flex-shrink: 0;
}

.tool-search-item-info {
    min-width: 0;
    max-width: 100%;
}
.tool-search-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
}
.tool-search-item-desc {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
    line-height: 1.5;
}

/* 关键词高亮 */
.ts-hl {
    color: #7c5cf8;
    font-weight: 600;
    background: rgba(124, 92, 248, .08);
    border-radius: 2px;
    padding: 0 1px;
}

/* 底栏快捷键提示 */
.tool-search-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    border-top: 1px solid #f0f0f0;
    font-size: 11px;
    color: #94a3b8;
}
.tool-search-footer kbd {
    font-family: 'JetBrains Mono', monospace;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 10px;
}

/* 暗色主题适配 */
body.dark-mode .tool-search-overlay { background: rgba(0, 0, 0, .6); }
body.dark-mode .tool-search-box { background: #1e293b; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
body.dark-mode .tool-search-input-wrap { border-bottom-color: #334155; }
body.dark-mode .tool-search-input { color: #e2e8f0; }
body.dark-mode .tool-search-item:hover { background: #273548; }
body.dark-mode .tool-search-item.ts-active { background: linear-gradient(135deg, #312e81 0%, #1e3a5f 100%); }
body.dark-mode .tool-search-item-name { color: #e2e8f0; }
body.dark-mode .tool-search-item-icon { background: #334155; color: #a78bfa; }
body.dark-mode .tool-search-footer { border-top-color: #334155; }
body.dark-mode .tool-search-category { color: #64748b; }
body.dark-mode .tool-search-kbd { background: #334155; border-color: #475569; }
body.dark-mode .nav-search-btn { background: #1e293b; border-color: #334155; color: #94a3b8; }
body.dark-mode .nav-search-btn:hover { background: #273548; border-color: #475569; }
body.dark-mode .nav-search-btn kbd { background: #334155; border-color: #475569; }

/* 响应式 */
@media (max-width: 768px) {
    .nav-search-btn .search-hint-text,
    .nav-search-btn kbd { display: none; }
    .nav-search-btn { padding: 6px 8px; margin-right: 4px; }
    .tool-search-overlay { padding-top: 4vh; }
    .tool-search-box { border-radius: 12px; max-width: 95vw; }
    .tool-search-results { max-height: 55vh; }
    .tool-search-footer { display: none; }
}
