/* 评论组件样式 - 作者: Bill */

/* 评论区容器 */
.comment-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background-color: var(--bg-light);
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 评论头部 */
.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.comment-title {
  font-size: 1.25rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comment-count {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: normal;
}

.ai-reply-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.ai-reply-badge i {
  margin-right: 0.25rem;
}

/* 评论表单 */
.comment-form-container {
  display: flex;
  margin-bottom: 2rem;
}

.comment-user-avatar {
  margin-right: 1rem;
}

.comment-user-avatar .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-form {
  flex: 1;
}

.comment-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}

.comment-form-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 评论列表 */
.comment-list-container {
  margin-top: 1.5rem;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.no-comments {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
}

.no-comments i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* 评论项 */
.comment-item {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.comment-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.comment-container {
  position: relative;
}

.comment-user {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.comment-avatar {
  margin-right: 0.75rem;
}

.comment-avatar .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-user-info {
  flex: 1;
}

.comment-user-name {
  font-weight: 500;
  color: var(--text-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comment-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  background-color: var(--info-light);
  color: var(--info);
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.ai-badge i {
  margin-right: 0.25rem;
}

/* 评论内容 */
.comment-content {
  margin-left: 3rem;
  margin-bottom: 0.75rem;
}

.comment-reply-to {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.comment-text {
  word-break: break-word;
  line-height: 1.6;
}

.comment-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.comment-image {
  width: 100px;
  height: 100px;
  border-radius: 0.25rem;
  overflow: hidden;
}

.comment-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 评论操作 */
.comment-actions {
  display: flex;
  align-items: center;
  margin-left: 3rem;
  gap: 1rem;
}

.comment-actions .btn-link {
  color: var(--text-muted);
  padding: 0;
  font-size: 0.9rem;
}

.comment-actions .btn-link:hover {
  color: var(--primary);
  text-decoration: none;
}

.like-btn.liked {
  color: var(--danger);
}

/* 回复表单 */
.reply-form-container {
  margin-left: 3rem;
  margin-top: 1rem;
}

.reply-form-hidden {
  display: none;
}

.reply-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.reply-form-tools {
  display: flex;
  gap: 0.5rem;
}

/* 子评论 */
.comment-replies {
  margin-left: 3rem;
  margin-top: 1.5rem;
  border-left: 2px solid var(--border-light);
  padding-left: 1.5rem;
  list-style: none;
}

/* 加载更多 */
.load-more-container {
  margin-top: 1.5rem;
  text-align: center;
}

/* 登录提示 */
.comment-login-prompt,
.comment-closed-prompt {
  text-align: center;
  padding: 2rem;
  background-color: var(--bg-light);
  border-radius: 0.5rem;
  color: var(--text-muted);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .comment-content,
  .comment-actions,
  .reply-form-container,
  .comment-replies {
    margin-left: 0;
  }
  
  .comment-form-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .comment-form-actions button[type="submit"] {
    width: 100%;
  }
}

/* {25/01/21:now,cursor.Bill+添加AI回复相关样式} */
/* AI回复等待提示 */
.ai-reply-hint {
  background-color: #e3f2fd;
  border-color: #2196f3;
  color: #1976d2;
  font-size: 14px;
  padding: 10px 15px;
  border-radius: 4px;
  animation: fadeIn 0.3s ease;
}

.ai-reply-hint .spinner-border {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* AI助手标识 */
.comment-user-name.badge.bg-primary {
  font-size: 12px;
  padding: 4px 8px;
  background-color: #2196f3 !important;
}

/* AI头像样式 */
.comment-avatar[alt="AI助手"] {
  border: 2px solid #2196f3;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

/* AI回复动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 回复容器样式优化 */
.comment-replies {
  padding-left: 50px;
  border-left: 3px solid #e3f2fd;
  margin-left: 25px;
  position: relative;
}

.comment-replies::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 0;
  width: 3px;
  height: 20px;
  background: linear-gradient(to bottom, #2196f3, #e3f2fd);
}

/* AI回复项样式 */
.comment-reply[data-comment-id] .comment-header img {
  width: 36px;
  height: 36px;
}

.comment-reply[data-comment-id] {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .comment-replies {
    padding-left: 20px;
    margin-left: 10px;
  }
  
  .ai-reply-hint {
    font-size: 13px;
    padding: 8px 12px;
  }
}
