/* Qihan add-on styles: AI panel, smart search, realtime badge.
   Self-contained so existing stylesheets stay untouched. */

.ai-panel {
  margin-top: 28px;
  padding: 22px 24px 26px;
  border: 1px solid #e5e2da;
  border-radius: 14px;
  background: #fbfaf7;
}

.ai-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-panel-head h2 {
  margin: 0;
  font-size: 20px;
}

.ai-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: #17211f;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.ai-hint {
  margin: 10px 0 14px;
  color: #6b675e;
  font-size: 14px;
  line-height: 1.7;
}

.ai-panel form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-panel textarea {
  min-height: 96px;
  padding: 12px;
  border: 1px solid #d8d4ca;
  border-radius: 10px;
  font: inherit;
  resize: vertical;
  background: #fff;
}

.ai-panel textarea:focus {
  outline: 2px solid #17211f;
  outline-offset: 1px;
}

.ai-result {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e5e2da;
}

.ai-answer {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.85;
  font-size: 15px;
  color: #26231d;
}

.ai-sources {
  margin: 12px 0 0;
  font-size: 13px;
  color: #6b675e;
}

.ai-sources a {
  color: #17211f;
  text-decoration: underline;
}

.ai-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: #9b968a;
}

.archive-search-group {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

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

.archive-smart {
  padding: 0 16px;
  border: 1px solid #17211f;
  border-radius: 999px;
  background: #17211f;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.archive-smart:disabled {
  opacity: 0.6;
  cursor: wait;
}

@media (max-width: 640px) {
  .ai-panel {
    padding: 18px 16px 20px;
  }

  .archive-search-group {
    width: 100%;
  }
}
