/* 搜索弹窗遮罩 */
.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.search-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 搜索弹窗容器 */
.search-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 680px;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* 搜索头部 */
.search-modal-header {
    padding: 24px 24px 0;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 12px;
    padding: 0 16px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.search-input-wrapper:focus-within {
    background-color: #fff;
    border-color: #0292fe;
    box-shadow: 0 0 0 4px rgba(2, 146, 254, 0.1);
}

.search-input-wrapper .search-icon {
    color: #999;
    font-size: 20px;
    margin-right: 12px;
}

.search-input-wrapper input {
    flex: 1;
    height: 52px;
    border: none;
    background: transparent;
    font-size: 16px;
    color: #333;
    outline: none;
}

.search-input-wrapper input::placeholder {
    color: #999;
}

.search-input-wrapper .search-clear {
    display: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.search-input-wrapper .search-clear:hover {
    color: #666;
}

.search-input-wrapper .search-clear.show {
    display: block;
}

/* 搜索关闭按钮 */
.search-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.search-modal-close:hover {
    background-color: #e5e5e5;
}

.search-modal-close .layui-icon {
    font-size: 16px;
    color: #666;
}

/* 分类Tab */
.search-tabs {
    display: flex;
    padding: 16px 24px 0;
    gap: 8px;
}

.search-tab-item {
    padding: 8px 20px;
    font-size: 14px;
    color: #666;
    background-color: #f5f5f5;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-tab-item:hover {
    background-color: #e8e8e8;
}

.search-tab-item.active {
    background-color: #0292fe;
    color: #fff;
}

/* 搜索内容区 */
.search-modal-body {
    padding: 20px 24px;
    max-height: 400px;
    overflow-y: auto;
}

.search-modal-body::-webkit-scrollbar {
    width: 6px;
}

.search-modal-body::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.search-modal-body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.search-modal-body::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* 热门搜索 */
.search-section {
    margin-bottom: 24px;
}

.search-section:last-child {
    margin-bottom: 0;
}

.search-section-title {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #999;
    margin-bottom: 12px;
}

.search-section-title i {
    margin-right: 6px;
    font-size: 16px;
}

.search-section-title .clear-history {
    margin-left: auto;
    font-size: 12px;
    color: #999;
    cursor: pointer;
}

.search-section-title .clear-history:hover {
    color: #0292fe;
}

/* 标签样式 */
.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 14px;
    color: #666;
    background-color: #f5f5f5;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-tag:hover {
    background-color: #0292fe;
    color: #fff;
}

.search-tag.hot {
    position: relative;
}

.search-tag.hot::after {
    content: "热";
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 10px;
    padding: 2px 4px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: #fff;
    border-radius: 4px;
}

/* 搜索结果 */
.search-results {
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    margin-bottom: 8px;
    background-color: #f9f9f9;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-result-item:hover {
    background-color: #f0f7ff;
    transform: translateX(4px);
}

.search-result-item:last-child {
    margin-bottom: 0;
}

.search-result-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e8f4ff;
    border-radius: 10px;
    margin-right: 14px;
    flex-shrink: 0;
}

.search-result-icon i {
    font-size: 18px;
    color: #0292fe;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 15px;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-title em {
    color: #0292fe;
    font-style: normal;
}

.search-result-desc {
    font-size: 13px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-type {
    font-size: 12px;
    color: #0292fe;
    background-color: #e8f4ff;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 12px;
    flex-shrink: 0;
}

/* 加载状态 */
.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: #999;
}

.search-loading i {
    font-size: 32px;
    color: #0292fe;
    margin-bottom: 12px;
}

/* 空状态 */
.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: #999;
}

.search-empty i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 12px;
}

.search-empty p {
    font-size: 14px;
}

/* 快捷键提示 */
.search-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #999;
}

.search-shortcuts {
    display: flex;
    gap: 16px;
}

.search-shortcut {
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-shortcut kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-family: inherit;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 1px 0 #e0e0e0;
}

/* 响应式 */
@media screen and (max-width: 768px) {
    .search-modal {
        width: 95%;
        max-width: none;
        max-height: 90vh;
    }
    
    .search-modal-body {
        max-height: 50vh;
    }
    
    .search-tabs {
        overflow-x: auto;
        padding-bottom: 8px;
    }
    
    .search-tab-item {
        white-space: nowrap;
    }
    
    .search-modal-footer {
        display: none;
    }
}
