/* search.css */

/* ========== Header 搜索栏 ========== */
.header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: auto;
  min-height: 70px;
}

.header .search-container {
  flex: 1;
  max-width: 600px;
  margin: 0 20px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header .search-box-wrapper {
  width: 100%;
}

.table-links {
  color: #333;
}

.header .search-box {
  width: 100%;
  display: flex;
  position: relative;
  height: 50px;
  border-radius: 10px;
  background-color: #f5f5f5;
  overflow: hidden;
  transition: all 0.3s;
}

.header .search-input {
  flex: 1;
  height: 100%;
  border: none;
  padding: 10px 110px 10px 10px;
  font-size: 14px;
  background: transparent;
  outline: none;
  border-radius: 10px !important;
}

.header .image-search-button {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background-color: #1e88e5;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 2;
}

.header .image-search-button:hover {
  background-color: #1565c0;
}

.header .image-search-button i {
  font-size: 20px;
}

.header .search-button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.header .search-button:hover {
  background-color: var(--primary-color-dark);
}

.header .search-button svg {
  width: 18px;
  height: 18px;
}

.header .header-left {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.header .header-right {
  flex: 0 0 auto;
}

.main-container {
  padding: 20px !important;
  min-height: calc(100vh - 150px);
  background-color: #f8f9fa;
}

.main-container .search-container {
  max-width: none !important;
  margin: 0 !important;
  text-align: left !important;
  position: relative;
  z-index: 100;
}

.main-container .search-box-wrapper {
  padding: 0 !important;
  margin-bottom: 20px;
}

.search-layout {
  display: flex !important;
  flex-direction: row !important;
  gap: 20px;
  max-width: 1800px;
  margin: 0 auto;
  align-items: flex-start;
}

.search-sidebar {
  width: 240px;
  min-width: 240px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  position: sticky;
  top: 85px;
}

.search-main {
  flex: 1;
  min-width: 0;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #157540;
  color: #fff;
  cursor: pointer;
  user-select: none;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s;
}

.sidebar-section-header:hover {
  background: #157540;
}

.sidebar-section + .sidebar-section .sidebar-section-header {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-arrow {
  font-size: 18px;
  transition: transform 0.25s ease;
}

.sidebar-arrow.rotated {
  transform: rotate(180deg);
}

.sidebar-section-body {
  padding: 6px 0;
  max-height: 400px;
  overflow-y: auto;
}

.sidebar-section-body .padding{
  padding: 0 20px;
  min-height: 100px;
}

.sidebar-section-body .slider{
  margin-bottom: 40px;
}

.sidebar-section-body::-webkit-scrollbar {
  width: 4px;
}

.sidebar-section-body::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 5px;
  font-size: 13px;
  color: #555;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.sidebar-item:hover {
  background-color: rgba(21,117,64,.1);
  color: #157540;
  border-left-color: #157540;
}

.sidebar-item.active {
  background-color: #e8f2fc;
  color: #157540;
  font-weight: 600;
  border-left-color: #157540;
}

.sidebar-section-body .checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid #ccc;
  margin-right: 10px;
}

.sidebar-section-body .checkbox.active {
  background-color: #157540;
  border-color: #157540;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;

}

.sidebar-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 6px;
}

.sidebar-item-count {
  color: #999;
  font-size: 12px;
  flex-shrink: 0;
}

.sidebar-item.active .sidebar-item-count {
  color: #5a9fd4;
}

.search-main .search-container {
  margin-bottom: 16px !important;
}
.search-container{
}
.search-main .search-box {
  width: 100%;
  display: flex;
  position: relative;
  height: 50px;
  /*border-radius: 10px;*/
  background-color: #f5f5f5;
  transition: all 0.3s;
}

.search-main .search-input {
  flex: 1;
  height: 100% !important;
  border: none !important;
  padding: 10px 110px 10px 15px !important;
  font-size: 14px;
  background: transparent;
  outline: none;
  border-radius: 10px !important;
  box-shadow: none !important;
  width: auto !important;
}

.search-main .image-search-button {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background-color: #1e88e5;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 2;
}

.search-main .image-search-button:hover {
  background-color: #1565c0;
}

.search-main .image-search-button i {
  font-size: 20px;
}

.search-main .search-button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.search-main .search-button:hover {
  background-color: var(--primary-color-dark);
}

.search-main .search-button svg {
  width: 18px;
  height: 18px;
}

/* ========== 聊天助手窗口 ========== */
.chat-assistant-box {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid #e8e8e8;
  transition: box-shadow 0.2s;
}

.chat-assistant-box:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(135deg, #f8f9fa, #fff);
  border-bottom: 1px solid #eee;
  cursor: pointer;
  user-select: none;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-ai-avatar-small {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.chat-header-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.chat-toggle-icon {
  font-size: 18px;
  color: #999;
  transition: transform 0.25s ease;
}

.chat-toggle-icon.rotated {
  transform: rotate(180deg);
}

.chat-body {
  display: flex;
  flex-direction: column;
  height: 200px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-messages.no-start{
  display: flex;
  justify-content: center;
  align-content: center;
  background: #f8f9fa;
}
.no-start .tip{
  text-align: center;
  color: #666;
  font-size: 14px;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 4px;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.chat-message.user-message {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 2px;
}

.chat-bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.ai-bubble {
  background-color: #f4f4f5;
  color: #333;
  border-top-left-radius: 4px;
}

.user-bubble {
  background-color: #157540;
  color: #fff;
  border-top-right-radius: 4px;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #999;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.chat-input-bar {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid #eee;
  gap: 8px;
  background: #fafafa;
}

.chat-input {
  flex: 1;
  height: 32px;
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 0 14px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: #157540;
}

.chat-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #157540;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background-color: #157540;
}

.chat-send-btn i {
  font-size: 14px;
}

.pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0;
  padding: 15px 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-wrap: wrap;
  gap: 15px;
}

.pagination-info {
  display: flex;
  gap: 20px;
  color: #666;
  font-size: 14px;
}

.pagination-info span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #ddd;
  background-color: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  color: #666;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background-color: rgba(21, 117, 64, 0.05);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-btn i {
  font-size: 16px;
}

.pagination-numbers {
  display: flex;
  gap: 5px;
}

.pagination-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #ddd;
  background-color: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  color: #666;
  font-size: 14px;
}

.pagination-number:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background-color: rgba(21, 117, 64, 0.05);
}

.pagination-number.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.pagination-jump {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666;
  font-size: 14px;
}

.jump-input {
  width: 60px;
  height: 36px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0 8px;
  text-align: center;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
}

.jump-input:focus {
  border-color: var(--primary-color);
}

.jump-btn {
  padding: 8px 12px;
  border: 1px solid #ddd;
  background-color: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  color: #666;
  font-size: 14px;
}

.jump-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background-color: rgba(21, 117, 64, 0.05);
}

/* ========== 搜索高亮 ========== */
.search-highlight {
  background: linear-gradient(135deg, #ff4757, #ff3742);
  color: white;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(255, 71, 87, 0.3);
  animation: highlightPulse 1.5s ease-in-out infinite alternate;
}

@keyframes highlightPulse {
  0% { box-shadow: 0 1px 3px rgba(255, 71, 87, 0.3); }
  100% { box-shadow: 0 2px 6px rgba(255, 71, 87, 0.5); }
}

/* ========== 空状态 ========== */
.empty-search-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin: 20px 0;
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.empty-state-icon {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f7fa, #e8ecf1);
  border-radius: 50%;
  margin-bottom: 30px;
  animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.empty-state-icon i {
  font-size: 60px;
  color: #bdc3c7;
}

.empty-state-title {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin: 0 0 15px 0;
}

.empty-state-message {
  font-size: 16px;
  color: #666;
  margin: 0 0 30px 0;
  text-align: center;
  line-height: 1.6;
  max-width: 500px;
}

.custom-order-button {
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-color), #0f5d34);
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(21, 117, 64, 0.3);
}

.custom-order-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(21, 117, 64, 0.4);
}

.custom-order-button:active {
  transform: translateY(-1px);
}

.custom-order-button i {
  font-size: 20px;
}

/* ========== 响应式 ========== */
@media (max-width: 992px) {
  .search-layout {
    flex-direction: column !important;
  }
  .search-sidebar {
    width: 100%;
    min-width: 0;
    position: static;
  }
  .sidebar-section-body {
    max-height: 200px;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    padding: 10px;
  }
  .header .search-container {
    margin: 10px 0;
    max-width: 100%;
  }
  .header .header-left,
  .header .header-right {
    width: 100%;
    justify-content: space-between;
  }
  .pagination-container {
    flex-direction: column;
    gap: 15px;
  }
  .pagination-info {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  .empty-search-state {
    padding: 60px 20px;
  }
  .empty-state-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 25px;
  }
  .empty-state-icon i {
    font-size: 50px;
  }
  .empty-state-title {
    font-size: 20px;
  }
  .empty-state-message {
    font-size: 14px;
    margin-bottom: 25px;
  }
  .custom-order-button {
    padding: 12px 32px;
    font-size: 15px;
  }
  .custom-order-button i {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .empty-search-state {
    padding: 40px 15px;
  }
  .empty-state-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
  }
  .empty-state-icon i {
    font-size: 40px;
  }
  .empty-state-title {
    font-size: 18px;
  }
  .empty-state-message {
    font-size: 13px;
  }
  .custom-order-button {
    width: 100%;
    justify-content: center;
  }
}
