/* AI 助手面板 */
.ai-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
  box-shadow: 0 4px 20px 0 rgba(0,0,0,.15);
  z-index: 1000;
  margin-top: 8px;
  max-height: 500px;
  min-height: 200px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: aiPanelSlideDown 0.2s ease-out;
}

@keyframes aiPanelSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-panel-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, #6578f5 0%, #4248e3 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.ai-panel-header i {
  font-size: 18px;
}

.ai-panel-content {
  padding: 20px;
  overflow-y: auto;
  max-height: 400px;
  flex: 1;
}

.ai-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #909399;
  font-size: 14px;
}

.ai-loading i {
  font-size: 16px;
  color: #667eea;
}

.ai-response {
  font-size: 14px;
  line-height: 1.8;
  color: #303133;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* 接口卡片样式 */
.api-card {
  margin: 10px 0;
  border: 1px solid #e4e7ed;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.api-card:hover {
  border-color: #667eea;
  box-shadow: 0 2px 12px rgba(102,126,234,0.15);
}

.api-card-main {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  gap: 8px;
}

.api-card-name {
  flex: 1;
  font-weight: 500;
  color: #303133;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.api-card-path {
  color: #909399;
  font-size: 12px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-card-link {
  color: #fff;
  background: linear-gradient(135deg, #6578f5 0%, #4248e3 100%);
  text-decoration: none;
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 20px;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.api-card-link:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(102,126,234,0.4);
}

.api-card-scene {
  padding: 6px 16px;
  font-size: 12px;
  color: #909399;
  background: #fafafa;
  border-top: 1px solid #f0f0f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-card-perm {
  padding: 6px 16px;
  font-size: 12px;
  border-top: 1px solid #f0f0f0;
  color: #606266;
}

.api-card-perm.perm-free {
  background: #f0f9eb;
  color: #67c23a;
}

.api-card-perm.perm-required {
  background: #fdf6ec;
  color: #e6a23c;
}

/* 接口标签 */
.api-card-badge {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  white-space: nowrap;
}

.api-card-badge.badge-value {
  background: linear-gradient(135deg, #f56c6c 0%, #e6a23c 100%);
  color: #fff;
}

/* 接入指南样式 */
.guide-card {
  background: #fff;
}

.guide-title {
  font-size: 15px;
  font-weight: 600;
  color: #303133;
  padding: 10px 0;
  border-bottom: 2px solid #667eea;
  margin-bottom: 10px;
}

.guide-section {
  margin-bottom: 12px;
  border: 1px solid #e4e7ed;
  border-radius: 6px;
  overflow: hidden;
}

.guide-section-title {
  font-size: 13px;
  font-weight: 500;
  color: #303133;
  padding: 8px 12px;
  background: #f5f7fa;
  border-bottom: 1px solid #e4e7ed;
}

.guide-section-content {
  font-size: 12px;
  color: #606266;
  line-height: 1.6;
  padding: 8px 12px;
  max-height: 120px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.guide-section-content:hover {
  max-height: 2000px;
}

.guide-section-content ul {
  margin: 4px 0;
  padding-left: 16px;
}

.guide-section-content li {
  margin: 2px 0;
}

.guide-section-content code {
  background: #f5f7fa;
  padding: 1px 4px;
  border-radius: 3px;
  color: #e6a23c;
  font-size: 11px;
}

.guide-section-content strong {
  color: #303133;
}

.guide-section-content a {
  color: #667eea;
  text-decoration: none;
}

.guide-section-content a:hover {
  text-decoration: underline;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 11px;
}

.guide-table th,
.guide-table td {
  border: 1px solid #e4e7ed;
  padding: 4px 8px;
  text-align: left;
}

.guide-table th {
  background: #f5f7fa;
  font-weight: 500;
  color: #303133;
}

.guide-table td {
  color: #606266;
}

/* 联系提示样式 */
.contact-box {
  text-align: center;
  padding: 20px;
  background: #fdf6ec;
  border-radius: 8px;
  border: 1px solid #e6a23c;
}

.contact-box i {
  font-size: 32px;
  color: #e6a23c;
  display: block;
  margin-bottom: 10px;
}

.contact-text {
  font-size: 14px;
  color: #606266;
  margin-bottom: 12px;
  line-height: 1.6;
}

.contact-qq {
  font-size: 18px;
  font-weight: 600;
  color: #303133;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.contact-btn {
  display: inline-block;
  padding: 8px 24px;
  background: linear-gradient(135deg, #6578f5 0%, #4248e3 100%);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.contact-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(102,126,234,0.4);
}

/* 提示信息样式 */
.ai-response .ai-tip-box {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 10px 0;
  color: #856404;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-response .ai-tip-box::before {
  content: "⚠️";
  font-size: 18px;
}

/* 空结果样式 */
.ai-response .ai-empty {
  text-align: center;
  padding: 20px;
  color: #909399;
  font-size: 14px;
}

.ai-response .ai-empty::before {
  content: "📭";
  display: block;
  font-size: 32px;
  margin-bottom: 10px;
}

.ai-response pre {
  background: #f5f7fa;
  border-radius: 4px;
  padding: 12px;
  margin: 8px 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.ai-response code {
  background: #f5f7fa;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
  color: #e6a23c;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

.ai-response pre code {
  background: none;
  padding: 0;
  color: #303133;
  display: block;
  white-space: pre-wrap;
}

.ai-response strong {
  color: #409eff;
  font-weight: 600;
}

.ai-error {
  color: #f56c6c;
  font-size: 14px;
}

.ai-panel-footer {
  padding: 8px 16px;
  background: #f5f7fa;
  border-top: 1px solid #e4e7ed;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-tip {
  font-size: 12px;
  color: #909399;
}

.ai-docs-link {
  font-size: 12px;
  color: #667eea;
  text-decoration: none;
  padding: 2px 8px;
  border: 1px solid #667eea;
  border-radius: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ai-docs-link:hover {
  background: #667eea;
  color: #fff;
}

/* Toast 提示 */
.ai-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 99999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.ai-toast.ai-toast-show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* 搜索框相对定位 */
.search-block {
  position: relative;
}

/* AI 图标动画 */
.ai-panel-header i {
  animation: float 3s ease-in-out infinite;
}

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