/* 健康知识库搜索框样式优化 */

/* 搜索区域卡片 */
.kb-search-section {
  padding: 20px;
  background: linear-gradient(135deg, rgba(24,144,255,0.05) 0%, rgba(24,144,255,0.02) 100%);
  border: 1px solid rgba(24,144,255,0.1);
}

/* 搜索区域头部 */
.kb-search-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.kb-search-section__title-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.kb-search-section__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-primary) 0%, rgba(24,144,255,0.8) 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(24,144,255,0.25);
  flex-shrink: 0;
}

.kb-search-section__title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

/* 急救指南按钮 */
.kb-emergency-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(255,77,79,0.25);
  white-space: nowrap;
}

.kb-emergency-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255,77,79,0.35);
}

.kb-emergency-btn:active {
  transform: translateY(0);
}

.kb-emergency-btn__icon {
  font-size: 16px;
}

.kb-emergency-btn__text {
  font-size: 13px;
}

/* 搜索框容器 */
.kb-search-box {
  position: relative;
}

.kb-search-box__wrapper {
  display: flex;
  align-items: center;
  background: var(--color-bg-elev);
  border: 2px solid var(--color-border);
  border-radius: 16px;
  padding: 4px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.kb-search-box__wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 4px 16px rgba(24,144,255,0.15);
  transform: translateY(-1px);
}

.kb-search-box__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
  font-size: 18px;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.kb-search-box__wrapper:focus-within .kb-search-box__icon {
  color: var(--color-primary);
}

.kb-search-box__input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--color-text);
  outline: none;
  min-width: 0;
}

.kb-search-box__input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

.kb-search-box__btn {
  height: 40px;
  padding: 0 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary) 0%, rgba(24,144,255,0.9) 100%);
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(24,144,255,0.25);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kb-search-box__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24,144,255,0.35);
}

.kb-search-box__btn:active {
  transform: translateY(0);
}

.kb-search-box__btn-text {
  font-size: 14px;
  font-weight: 600;
}

/* 搜索建议列表 */
.kb-search-suggest {
  margin-top: 12px;
  display: none;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  animation: fadeInDown 0.3s ease;
}

.kb-search-suggest:not(:empty) {
  display: flex;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kb-search-suggest .article-card {
  margin-bottom: 0;
  border-radius: 12px;
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.kb-search-suggest .article-card:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.kb-search-suggest .article-card__header {
  margin-bottom: 0;
  gap: 10px;
}

.kb-search-suggest .article-card__icon {
  width: 40px;
  height: 40px;
  font-size: 20px;
}

.kb-search-suggest .article-card__title {
  font-size: 15px;
  margin-bottom: 4px;
}

.kb-search-suggest .article-card__meta {
  font-size: 11px;
  margin-top: 4px;
  gap: 8px;
}

/* 移动端优化 */
@media (max-width: 767px) {
  .kb-search-section {
    padding: 16px;
  }

  .kb-search-section__header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }

  .kb-search-section__title-wrapper {
    justify-content: center;
  }

  .kb-emergency-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
  }

  .kb-search-box__wrapper {
    flex-wrap: wrap;
    padding: 3px;
    border-radius: 14px;
  }

  .kb-search-box__icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .kb-search-box__input {
    padding: 8px 10px;
    font-size: 14px;
    order: 2;
    width: 100%;
    min-width: 0;
  }

  .kb-search-box__btn {
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
    order: 3;
    width: 100%;
    margin-top: 4px;
  }

  .kb-search-box__btn-text {
    font-size: 13px;
  }

  .kb-search-suggest {
    margin-top: 8px;
    max-height: 250px;
  }
}

/* 深色模式适配 */
[data-theme="dark"] .kb-search-section {
  background: linear-gradient(135deg, rgba(24,144,255,0.1) 0%, rgba(24,144,255,0.05) 100%);
  border-color: rgba(24,144,255,0.2);
}

[data-theme="dark"] .kb-search-box__wrapper {
  background: var(--color-bg-elev);
  border-color: var(--color-border);
}

[data-theme="dark"] .kb-search-box__wrapper:focus-within {
  box-shadow: 0 4px 16px rgba(24,144,255,0.25);
}

/* 滚动条样式 */
.kb-search-suggest::-webkit-scrollbar {
  width: 6px;
}

.kb-search-suggest::-webkit-scrollbar-track {
  background: transparent;
}

.kb-search-suggest::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.kb-search-suggest::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

