/* 搜索框包装器 */
.search-wrapper {
    position: relative;
    z-index: 9999;
}

/* 搜索结果容器 - 统一固定在顶部 */
#search-results-container {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    max-height: 450px;
    overflow-y: auto;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
    z-index: 2147483647;
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

/* 搜索结果项 */
.search-result-item {
    padding: 15px 18px;
    border-bottom: 1px solid #edf2f7;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f0f9ff;
    transform: translateX(3px);
}

.search-result-title {
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 6px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-result-title:before {
    content: "🔗";
    font-size: 14px;
}

.search-result-link {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
    word-break: break-all;
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
}

.search-result-highlight {
    background: #fef08a;
    color: #000;
    padding: 2px 4px;
    font-weight: 600;
    border-radius: 4px;
}

.search-result-count {
    padding: 12px 18px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px 12px 0 0;
}

.no-results {
    padding: 50px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 15px;
    background: #f8fafc;
    border-radius: 12px;
}

.search-loading {
    padding: 30px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

/* 手机端样式 */
@media (max-width: 996px) {
  .navbar__items--right .search-wrapper {
    width: 160px;
    margin-left: 5px;
    margin-right: 0;
    flex-shrink: 0;
  }
  
  .navbar__items--right .search-wrapper input {
    width: 100%;
    padding-left: 8px;
    padding-right: 8px;
    box-sizing: border-box;
  }
  
  /* 手机端结果容器适配 */
  #search-results-container {
    width: calc(100vw - 20px) !important;
    left: 10px !important;
    right: 10px !important;
    transform: none !important;
    top: 70px !important;
    max-height: 400px !important;
  }
}

@media (max-width: 480px) {
  .navbar__items--right .search-wrapper {
    width: 130px;
  }
  
  .navbar__items--right .search-wrapper input {
    width: 100%;
    font-size: 13px;
  }
  
  #search-results-container {
    max-height: 350px !important;
    top: 60px !important;
  }
}