/* 移动端搜索组件样式 */

/* 移动端搜索面板 */
.mobile-search-offcanvas {
    height: 100vh !important;
    background: #ffffff !important;
    border: none;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    display: flex !important;
    flex-direction: column !important;
    /* 硬件加速优化 */
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
}

/* 确保背景遮罩不影响面板 */
.mobile-search-offcanvas.show {
    background: #ffffff !important;
}

/* 移除Bootstrap默认背景遮罩 */
.mobile-search-offcanvas::before {
    display: none !important;
}

/* 使用Bootstrap原生遮罩层样式，移除自定义动画控制 */

/* 确保全屏高度 */
.mobile-search-offcanvas.offcanvas {
    height: 100vh !important;
    max-height: 100vh !important;
    background: #ffffff !important;
}

/* 确保offcanvas-header背景为白色 */
.mobile-search-offcanvas .offcanvas-header {
    background: #ffffff !important;
}

/* 确保offcanvas-body背景为白色 */
.mobile-search-offcanvas .offcanvas-body {
    background: #ffffff !important;
}

/* 移除自定义动画，使用Bootstrap原生动画 */

/* 搜索头部区域 - 固定高度76px */
.mobile-search-header {
    height: 76px;
    background: #ffffff !important;
    border-bottom: 1px solid #00000017;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* 确保offcanvas-header样式正确 */
.mobile-search-offcanvas .offcanvas-header {
    padding: 0;
    /* border-bottom: 1px solid #000000; */
    height: 76px;
    flex-shrink: 0;
}

.mobile-search-header .container-fluid {
    height: 100%;
    padding-left: 0;
    padding-right: 0;
}

.mobile-search-header .row {
    height: 100%;
}

/* 搜索表单 */
.mobile-search-form {
    width: 100%;
}

/* 移除Bootstrap默认样式 */
.mobile-search-offcanvas .offcanvas-body {
    padding: 0;
    flex: 1;
    overflow-y: auto;
    height: calc(100vh - 76px);
    display: flex;
    flex-direction: column;
}

.mobile-search-input-group {
    background: #ffffff;
    border-radius: 0;
    padding: 8px 12px;
    /* border: 1px solid #000000; */
    border-top: none;
    border-right: none;
    border-bottom: none;
    transition: all 0.2s ease;
    width: 100%;
}

.mobile-search-input-group:focus-within {
    border-left-color: #000000;
    border-top: none;
    border-right: none;
    border-bottom: none;
    box-shadow: none;
}

/* 触摸边框样式 */
.mobile-search-input-group:active {
    border-left-color: #000000;
    border-top: none;
    border-right: none;
    border-bottom: none;
}

.mobile-search-input-group:focus {
    border-left-color: #000000;
    border-top: none;
    border-right: none;
    border-bottom: none;
    outline: none;
}

/* 搜索图标 */
.mobile-search-icon {
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* 搜索输入框 */
.mobile-search-input {
    border: none;
    background: transparent;
    font-size: 16px;
    color: #333;
    padding: 0;
    outline: none;
    font-weight: 400;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
}

/* 移除Bootstrap form-control默认样式 */
.mobile-search-input.form-control {
    border: none;
    box-shadow: none;
    border-radius: 0;
    background: transparent;
}

.mobile-search-input::placeholder {
    color: #999;
    font-size: 16px;
}

/* 清除按钮 */
.mobile-search-clear-btn {
    background: none;
    border: none;
    color: #999;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-search-clear-btn:hover {
    background: #f0f0f0;
    color: #666;
}

/* 关闭按钮 */
.search-close-btn {
    background: none;
    border: none;
    color: #333;
    padding: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.search-close-btn:hover {
    background: #f0f0f0;
    color: #000;
}

.search-close-btn:active {
    background: #e0e0e0;
}

/* 搜索内容区域 */
.mobile-search-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff !important;
}

/* 搜索区域 */
.mobile-search-section {
    margin-bottom: 32px;
}

.mobile-search-section:last-child {
    margin-bottom: 0;
}

/* 区域标题 */
.mobile-search-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    padding: 0 16px;
}

/* 热门搜索列表 */
.mobile-search-hot-list {
    padding: 0 16px;
}

.mobile-search-hot-item {
    display: flex;
    align-items: center;
    height: 70px;
    padding: 0 16px;
    border-bottom: 1px solid #e0e0e047;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mobile-search-hot-item:last-child {
    border-bottom: none;
}

.mobile-search-hot-item:hover {
    background-color: #f8f9fa;
}

.mobile-search-hot-item:active {
    background-color: #e9ecef;
}

/* 热门搜索排名 */
.mobile-search-hot-rank {
    width: 24px;
    height: 24px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-right: 12px;
    flex-shrink: 0;
}

.mobile-search-hot-item:nth-child(1) .mobile-search-hot-rank {
    background: #ff6b6b;
}

.mobile-search-hot-item:nth-child(2) .mobile-search-hot-rank {
    background: #ffa726;
}

.mobile-search-hot-item:nth-child(3) .mobile-search-hot-rank {
    background: #ffeb3b;
    color: #333;
}

.mobile-search-hot-item:nth-child(n+4) .mobile-search-hot-rank {
    background: #9e9e9e52;
}

/* 热门搜索文本 */
.mobile-search-hot-text {
    flex: 1;
    font-size: 16px;
    color: #333;
    font-weight: 400;
}

/* 热门搜索图标 - 隐藏箭头 */
.mobile-search-hot-icon {
    display: none;
}

/* 搜索历史列表 */
.mobile-search-history-list {
    padding: 0 16px;
}

.mobile-search-history-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mobile-search-history-item:last-child {
    border-bottom: none;
}

.mobile-search-history-item:hover {
    background-color: #f8f9fa;
}

.mobile-search-history-item:active {
    background-color: #e9ecef;
}

/* 搜索历史图标 */
.mobile-search-history-icon {
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

/* 搜索历史文本 */
.mobile-search-history-text {
    flex: 1;
    font-size: 15px;
    color: #333;
    font-weight: 400;
}

/* 删除历史按钮 */
.mobile-search-history-delete {
    background: none;
    border: none;
    color: #ccc;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-search-history-delete:hover {
    background: #f0f0f0;
    color: #999;
}

/* 搜索建议列表 */
.mobile-search-suggestions-list {
    padding: 0 16px;
}

.mobile-search-suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mobile-search-suggestion-item:last-child {
    border-bottom: none;
}

.mobile-search-suggestion-item:hover {
    background-color: #f8f9fa;
}

.mobile-search-suggestion-item:active {
    background-color: #e9ecef;
}

/* 搜索建议图标 */
.mobile-search-suggestion-icon {
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

/* 搜索建议文本 */
.mobile-search-suggestion-text {
    flex: 1;
    font-size: 15px;
    color: #333;
    font-weight: 400;
}

/* 响应式设计 */
@media (max-width: 576px) {
    .mobile-search-header {
        height: 70px;
    }
    
    .mobile-search-input-group {
        padding: 6px 10px;
    }
    
    .mobile-search-input {
        font-size: 15px;
    }
    
    .mobile-search-input::placeholder {
        font-size: 15px;
    }
    
    .mobile-search-cancel-btn {
        font-size: 15px;
    }
    
    .mobile-search-content {
        padding: 16px 0;
    }
    
    .mobile-search-section {
        margin-bottom: 24px;
    }
    
    .mobile-search-section-title {
        font-size: 15px;
        margin-bottom: 12px;
        padding: 0 12px;
    }
    
    .mobile-search-hot-list,
    .mobile-search-history-list,
    .mobile-search-suggestions-list {
        padding: 0 12px;
    }
    
    .mobile-search-hot-item {
        padding: 14px 0;
    }
    
    .mobile-search-history-item,
    .mobile-search-suggestion-item {
        padding: 10px 0;
    }
}

/* 强制白色背景 - 覆盖所有可能的背景色 */
/* .mobile-search-offcanvas,
.mobile-search-offcanvas *,
.mobile-search-offcanvas .offcanvas-header,
.mobile-search-offcanvas .offcanvas-body,
.mobile-search-offcanvas .mobile-search-header,
.mobile-search-offcanvas .mobile-search-content,
.mobile-search-offcanvas .container-fluid {
    background: #ffffff !important;
} */

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .mobile-search-offcanvas {
        background: #1a1a1a;
    }
    
    .mobile-search-header {
        background: #1a1a1a;
        border-bottom-color: #333;
    }
    
    .mobile-search-input-group {
        background: #2d2d2d;
        border-color: #444;
    }
    
    .mobile-search-input-group:focus-within {
        border-color: #007bff;
    }
    
    .mobile-search-input {
        color: #fff;
    }
    
    .mobile-search-input::placeholder {
        color: #999;
    }
    
    .mobile-search-icon {
        color: #999;
    }
    
    .mobile-search-clear-btn {
        color: #999;
    }
    
    .mobile-search-clear-btn:hover {
        background: #333;
        color: #ccc;
    }
    
    .mobile-search-cancel-btn {
        color: #007bff;
    }
    
    .mobile-search-section-title {
        color: #fff;
    }
    
    .mobile-search-hot-item {
        border-bottom-color: #333;
    }
    
    .mobile-search-hot-item:hover {
        background-color: #2d2d2d;
    }
    
    .mobile-search-hot-item:active {
        background-color: #333;
    }
    
    .mobile-search-hot-text {
        color: #fff;
    }
    
    .mobile-search-hot-icon {
        color: #666;
    }
    
    .mobile-search-history-item {
        border-bottom-color: #333;
    }
    
    .mobile-search-history-item:hover {
        background-color: #2d2d2d;
    }
    
    .mobile-search-history-item:active {
        background-color: #333;
    }
    
    .mobile-search-history-icon {
        color: #999;
    }
    
    .mobile-search-history-text {
        color: #fff;
    }
    
    .mobile-search-history-delete {
        color: #666;
    }
    
    .mobile-search-history-delete:hover {
        background: #333;
        color: #999;
    }
    
    .mobile-search-suggestion-item {
        border-bottom-color: #333;
    }
    
    .mobile-search-suggestion-item:hover {
        background-color: #2d2d2d;
    }
    
    .mobile-search-suggestion-item:active {
        background-color: #333;
    }
    
    .mobile-search-suggestion-icon {
        color: #999;
    }
    
    .mobile-search-suggestion-text {
        color: #fff;
    }
}

/* 移除自定义动画效果，使用Bootstrap原生动画 */

/* 滚动条样式 */
.mobile-search-content::-webkit-scrollbar {
    width: 4px;
}

.mobile-search-content::-webkit-scrollbar-track {
    background: transparent;
}

.mobile-search-content::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.mobile-search-content::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}
/* 深色模式滚动条 */
@media (prefers-color-scheme: dark) {
    .mobile-search-content::-webkit-scrollbar-thumb {
        background: #444;
    }
    
    .mobile-search-content::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

