/**
 * 评论模块样式
 * 用于小说详情页的评论功能
 */

/* ==================== 评论容器 ==================== */
.trigger-book-comment {
  margin-top: 0.25rem;
}

/* ==================== 评论列表 ==================== */
.book-ol-comment {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* 评论列表项 */
.comment-item {
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s;
  position: relative;
}

.comment-item:hover {
  background-color: #f9f9f9;
}

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

/* 评论主体 - 三列布局 */
.comment-main {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

/* 第一列：头像 */
.comment-avatar {
  flex-shrink: 0;
    width: 3.925rem;
    height: 3.925rem;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
  background: linear-gradient(135deg, #f8f7f8 0%, #f3c0dc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}


.comment-avatar .icon {
  width: 34px;
  height: 34px;
  color: #fff;
  flex-shrink: 0;
}

.comment-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* 第二列：内容区域（昵称、时间、评论内容） */
.comment-body {
  flex: 1;
  min-width: 0; /* 允许内容收缩 */
}

/* 评论头部 */
.comment-header {
  margin-bottom: 0.5rem;
}

.comment-user-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
}

.comment-username {
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* 时间和操作按钮行 */
.comment-time-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comment-time {
  color: #999;
  font-size: 0.8rem;
  line-height: 1.4;
}

/* 内联删除按钮 */
.comment-delete-btn-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.35rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #fff;
  color: #999;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
  font-size: 0;
}

.comment-delete-btn-inline:hover {
  border-color: #ff5252;
  background: #fff5f7;
  color: #ff5252;
  transform: scale(1.1);
}

.comment-delete-btn-inline .icon-delete {
  display: block;
}

/* 评论内容 */
.comment-content {
  color: #666;
  line-height: 1.6;
  font-size: 0.95rem;
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* 第三列：点赞区域 */
.comment-like-area {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  padding-top: 0.25rem;
}

/* 点赞按钮 */
.comment-like-btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #ff3955;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  outline: none;
  min-width: 50px;
}

.comment-like-btn:hover {
  border-color: #ff3955;
  color: #ff3955;
  background: #fff5f7;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(255, 57, 85, 0.1);
}

.comment-like-btn.liked {
  border-color: #ff3955;
  color: #ff3955;
  background: #fff5f7;
}

.comment-like-btn .like-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.comment-like-btn .like-count {
  font-size: 0.8rem;
  line-height: 1;
  font-weight: 500;
}

/* ==================== 状态提示 ==================== */
.empty-text,
.loading-text,
.error-text {
  padding: 3rem;
  text-align: center;
  color: #999;
  font-size: 0.95rem;
  display: block;
}

.loading-text::after {
  content: '...';
  animation: dotting 1.5s infinite;
}

@keyframes dotting {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

.error-text {
  color: #ff5252;
}

.empty-text {
  color: #bbb;
}

/* ==================== 加载更多按钮 ==================== */
.book-li-more-comments {
  display: block;
  text-align: center;
  padding: 1rem;
  color: #ff3955;
  cursor: pointer;
  transition: all 0.2s;
  border-top: 1px solid #eee;
}

.book-li-more-comments:hover {
  background: #fff5f7;
  color: #ff1744;
}

/* ==================== 响应式设计 ==================== */

/* 平板设备 */
@media (max-width: 1024px) {
  .comment-item {
    padding: 1.2rem;
  }
  
  .comment-avatar .icon {
    width: 20px;
    height: 20px;
  }
}

/* 移动设备 */
@media (max-width: 768px) {
  .comment-item {
    padding: 1rem;
  }
  
  .comment-main {
    gap: 0.75rem;
  }
  
  .comment-username {
    font-size: 0.9rem;
  }
  
  .comment-time {
    font-size: 0.75rem;
  }
  
  .comment-content {
    font-size: 0.9rem;
  }
  
  .comment-like-btn {
    padding: 0.4rem 0.6rem;
    min-width: 45px;
  }
  
  .comment-like-btn .like-icon {
    font-size: 1.328rem;
  }
  
  .comment-like-btn .like-count {
    font-size: 0.75rem;
  }
  
  .comment-delete-btn-inline {
    padding: 0.15rem 0.25rem;
  }
  
  .comment-delete-btn-inline .icon-delete {
    width: 12px;
    height: 12px;
  }
}

/* 小屏幕移动设备 */
@media (max-width: 480px) {
  .comment-item {
    padding: 0.8rem;
  }
  
  .comment-main {
    gap: 0.5rem;
  }
  
  .empty-text,
  .loading-text,
  .error-text {
    padding: 2rem 1rem;
    font-size: 0.85rem;
  }
}


/* ==================== 打印样式 ==================== */
@media print {
  .comment-like-btn,
  .comment-delete-btn-inline,
  .book-li-more-comments {
    display: none;
  }
  
  .comment-item {
    break-inside: avoid;
  }
}
