/* Search Panel 样式 */

.tl-mt-search-panel {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 700px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid #e2e8f0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    animation: zoomIn 0.2s ease;
}

body.dark .tl-mt-search-panel {
    background: #1e293b;
    border-color: #334155;
}

@keyframes zoomIn {
    from {
        transform: translateX(-50%) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
}

.tl-mt-search-header {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

body.dark .tl-mt-search-header {
    border-bottom-color: #334155;
}

.tl-mt-search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.tl-mt-search-icon {
    position: absolute;
    left: 16px;
    color: #94a3b8;
    font-size: 24px;
}

.tl-mt-search-input {
    width: 100%;
    padding: 12px 48px 12px 52px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    color: #0f172a;
    background: #f8fafc;
    transition: all 0.15s;
}

body.dark .tl-mt-search-input {
    background: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

.tl-mt-search-input:focus {
    outline: none;
    border-color: #0ea5e9;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

body.dark .tl-mt-search-input:focus {
    background: #1e293b;
}

.tl-mt-search-clear {
    position: absolute;
    right: 12px;
    width: 28px;
    height: 28px;
    background: #e2e8f0;
    border: none;
    border-radius: 50%;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

body.dark .tl-mt-search-clear {
    background: #334155;
    color: #94a3b8;
}

.tl-mt-search-clear:hover {
    background: #cbd5e1;
}

body.dark .tl-mt-search-clear:hover {
    background: #475569;
}

.tl-mt-search-close-btn {
    width: 48px;
    height: 48px;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

body.dark .tl-mt-search-close-btn {
    border-color: #334155;
    color: #94a3b8;
}

.tl-mt-search-close-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

body.dark .tl-mt-search-close-btn:hover {
    background: #334155;
    border-color: #475569;
}

.tl-mt-search-filters {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid #e2e8f0;
    overflow-x: auto;
}

body.dark .tl-mt-search-filters {
    border-bottom-color: #334155;
}

.tl-mt-search-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

body.dark .tl-mt-search-filter {
    border-color: #334155;
    color: #94a3b8;
}

.tl-mt-search-filter .material-symbols-outlined {
    font-size: 18px;
}

.tl-mt-search-filter:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

body.dark .tl-mt-search-filter:hover {
    background: #334155;
    border-color: #475569;
}

.tl-mt-search-filter.active {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: #ffffff;
}

.tl-mt-search-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.tl-mt-search-results::-webkit-scrollbar {
    width: 6px;
}

.tl-mt-search-results::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

body.dark .tl-mt-search-results::-webkit-scrollbar-thumb {
    background: #475569;
}

.tl-mt-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.tl-mt-search-empty .material-symbols-outlined {
    font-size: 64px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

body.dark .tl-mt-search-empty .material-symbols-outlined {
    color: #475569;
}

.tl-mt-search-empty p {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 24px 0;
}

body.dark .tl-mt-search-empty p {
    color: #94a3b8;
}

.tl-mt-search-recent {
    width: 100%;
    max-width: 400px;
}

.tl-mt-search-recent h4 {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 12px 0;
    text-align: left;
}

body.dark .tl-mt-search-recent h4 {
    color: #f1f5f9;
}

.tl-mt-search-recent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tl-mt-search-recent-item {
    padding: 6px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
}

body.dark .tl-mt-search-recent-item {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

.tl-mt-search-recent-item:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

body.dark .tl-mt-search-recent-item:hover {
    background: #475569;
    border-color: #64748b;
}

.tl-mt-search-result-list {
    padding: 8px;
}

.tl-mt-search-result-count {
    padding: 8px 12px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

body.dark .tl-mt-search-result-count {
    color: #94a3b8;
}

.tl-mt-search-result-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.tl-mt-search-result-item:hover {
    background: #f8fafc;
}

body.dark .tl-mt-search-result-item:hover {
    background: #334155;
}

.tl-mt-search-result-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tl-mt-search-result-icon.inventory {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
}

.tl-mt-search-result-icon.procurement {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.tl-mt-search-result-icon.quality {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.tl-mt-search-result-icon.alert {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.tl-mt-search-result-content {
    flex: 1;
    min-width: 0;
}

.tl-mt-search-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 4px 0;
}

body.dark .tl-mt-search-result-title {
    color: #f1f5f9;
}

.tl-mt-search-result-title mark {
    background: #fef08a;
    color: #854d0e;
    padding: 1px 3px;
    border-radius: 2px;
}

body.dark .tl-mt-search-result-title mark {
    background: #713f12;
    color: #fef08a;
}

.tl-mt-search-result-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.dark .tl-mt-search-result-desc {
    color: #94a3b8;
}

.tl-mt-search-result-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.tl-mt-search-result-type {
    padding: 2px 8px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 4px;
    font-weight: 500;
}

body.dark .tl-mt-search-result-type {
    background: #334155;
    color: #94a3b8;
}

.tl-mt-search-result-time {
    color: #94a3b8;
}

body.dark .tl-mt-search-result-time {
    color: #64748b;
}
