/* 文章对话组件样式 */

.article-dialog {
  margin: 2rem 0;
  padding: 1.5rem;
  border-radius: 12px;
  background: var(--card-background, #f8f9fa);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color, #e9ecef);
}

/* 深色模式支持 */
[data-theme="dark"] .article-dialog {
  background: var(--card-background, #2d333b);
  border-color: var(--border-color, #444c56);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dialog-title {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: var(--heading-color, #212529);
  font-weight: 600;
  display: flex;
  align-items: center;
}

.dialog-title::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'%3E%3C/path%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.dialog-container {
  min-height: 200px;
  max-height: 500px;
  overflow-y: auto;
  padding: 1rem;
  border-radius: 8px;
  background: var(--content-background, #ffffff);
}

[data-theme="dark"] .dialog-container {
  background: var(--content-background, #22272e);
}

/* 加载状态 */
.dialog-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--primary-color, #0d6efd);
  animation: spin 1s infinite linear;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

[data-theme="dark"] .spinner {
  border-color: rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-color, #58a6ff);
}

/* 对话消息样式 */
.dialog-messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dialog-message {
  display: flex;
  margin-bottom: 1rem;
}

.dialog-message.expert {
  flex-direction: row;
}

.dialog-message.learner {
  flex-direction: row-reverse;
}

.dialog-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.dialog-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dialog-bubble {
  max-width: calc(100% - 60px);
  padding: 12px 16px;
  border-radius: 18px;
  position: relative;
  margin: 0 10px;
}

.dialog-message.expert .dialog-bubble {
  background-color: var(--expert-bubble-bg, #e9f5ff);
  color: var(--expert-bubble-text, #0a58ca);
  border-bottom-left-radius: 4px;
}

.dialog-message.learner .dialog-bubble {
  background-color: var(--learner-bubble-bg, #f0f2f5);
  color: var(--learner-bubble-text, #495057);
  border-bottom-right-radius: 4px;
  text-align: right;
}

[data-theme="dark"] .dialog-message.expert .dialog-bubble {
  background-color: var(--expert-bubble-bg, #1e3a5f);
  color: var(--expert-bubble-text, #9ec5fe);
}

[data-theme="dark"] .dialog-message.learner .dialog-bubble {
  background-color: var(--learner-bubble-bg, #2d333b);
  color: var(--learner-bubble-text, #adbac7);
}

.dialog-speaker {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 4px;
  opacity: 0.8;
}

.dialog-text {
  line-height: 1.5;
}

/* 控制按钮 */
.dialog-controls {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  gap: 0.5rem;
}

.dialog-controls button {
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.dialog-refresh {
  background-color: transparent;
  color: var(--primary-color, #0d6efd);
}

.dialog-refresh:hover {
  background-color: var(--primary-color-light, #e7f1ff);
}

.dialog-toggle {
  background-color: transparent;
  color: var(--text-muted, #6c757d);
}

.dialog-toggle:hover {
  background-color: var(--gray-200, #e9ecef);
}

.dialog-refresh svg {
  margin-right: 6px;
}

[data-theme="dark"] .dialog-refresh:hover {
  background-color: var(--primary-color-dark, #0d3d71);
}

[data-theme="dark"] .dialog-toggle:hover {
  background-color: var(--gray-700, #373e47);
}

/* 错误消息 */
.dialog-error {
  padding: 1rem;
  border-radius: 8px;
  background-color: var(--danger-light, #f8d7da);
  color: var(--danger, #dc3545);
  text-align: center;
}

[data-theme="dark"] .dialog-error {
  background-color: var(--danger-dark, #31181a);
  color: var(--danger-light, #f8d7da);
}

.dialog-error-details {
  font-size: 0.875rem;
  margin-top: 0.5rem;
  opacity: 0.8;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .dialog-bubble {
    max-width: calc(100% - 50px);
  }
  
  .dialog-controls {
    flex-direction: column;
    align-items: stretch;
  }
} 