/**
 * Jekyll博客评论系统样式
 * 设计风格与现有博客保持一致
 */

/* 评论系统容器 */
.comments-container {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 评论表单容器 */
.comment-form-container {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.comment-title {
  color: #ffffff;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  text-align: center;
}

/* 表单样式 */
.comment-form {
  max-width: 100%;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  color: #e0e0e0;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: #64b5f6;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.2);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
  line-height: 1.5;
}

/* 字符计数 */
.char-count {
  text-align: right;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #7f8c8d;
}

/* 提交按钮 */
.form-actions {
  text-align: center;
}

.submit-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-loading {
  display: none;
}

/* 消息提示 */
.comment-message {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.comment-message-success {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.comment-message-error {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.comment-message-info {
  background: rgba(52, 152, 219, 0.2);
  color: #3498db;
  border: 1px solid rgba(52, 152, 219, 0.3);
}

/* 评论列表 */
.comments-section {
  margin-top: 2rem;
}

.comments-title {
  color: #ffffff;
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  text-align: center;
}

.comments-list {
  space-y: 1rem;
}

.comment-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.comment-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comment-author {
  color: #64b5f6; /* 保持蓝色，增强可读性 */
  font-weight: 600; /* 保持字重 */
  font-size: 0.95rem; /* 保持字号 */
  /* 淡化透明框效果，更加自然 */
  background: rgba(100, 181, 246, 0.05); /* 大幅降低背景透明度 */
  border: 1px solid rgba(100, 181, 246, 0.1); /* 大幅降低边框透明度 */
  padding: 2px 6px; /* 减少内边距 */
  border-radius: 3px; /* 减小圆角 */
  display: inline-block; /* 使 padding 生效 */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* 减轻文本阴影 */
  transition: all 0.3s ease; /* 添加过渡效果 */
}

.comment-author:hover {
  background: rgba(100, 181, 246, 0.1);
  border-color: rgba(100, 181, 246, 0.2);
  transform: translateY(-1px);
}

.comment-date {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
}

.comment-content {
  color: rgba(255, 255, 255, 0.95); /* 改为白色，提高夜晚模式可读性 */
  line-height: 1.6;
  font-size: 0.95rem;
  /* 淡化透明框效果，与评论作者保持一致 */
  background: rgba(255, 255, 255, 0.03) !important; /* 大幅降低背景透明度 */
  border: 1px solid rgba(255, 255, 255, 0.08); /* 大幅降低边框透明度 */
  padding: 8px 12px; /* 减少内边距 */
  border-radius: 4px; /* 减小圆角 */
  margin-top: 0.5rem; /* 与用户名隔开一些距离 */
  word-wrap: break-word;
  /* 确保文本可以被正常选择 */
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

/* 占位符样式 */
.loading-placeholder,
.no-comments,
.error-placeholder {
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
}

.error-placeholder {
  color: #e74c3c;
}

.retry-btn {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: all 0.3s ease;
}

.retry-btn:hover {
  background: rgba(231, 76, 60, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .comments-container {
    margin-top: 2rem;
    padding: 1rem 0;
  }
  
  .comment-form-container {
    padding: 1rem;
    margin: 0 -0.5rem 1.5rem;
  }
  
  .comment-title,
  .comments-title {
    font-size: 1.2rem;
  }
  
  .form-input,
  .form-textarea {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
  }
  
  .submit-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .comment-item {
    padding: 1rem;
    margin: 0 -0.5rem 1rem;
  }
  
  .comment-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .comment-author {
    font-size: 0.9rem;
  }
  
  .comment-date {
    font-size: 0.75rem;
  }
  
  .comment-content {
    font-size: 0.9rem;
  }
}

/* 夜间模式适配 */
.dark-mode .comment-form-container,
.dark-mode .comment-item {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .comment-item:hover {
  background: rgba(0, 0, 0, 0.4);
}

.dark-mode .form-input,
.dark-mode .form-textarea {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.15);
}

.dark-mode .form-input:focus,
.dark-mode .form-textarea:focus {
  background: rgba(0, 0, 0, 0.3);
  border-color: #64b5f6;
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.comment-item {
  animation: fadeInUp 0.3s ease-out;
}

.comment-message {
  animation: fadeInUp 0.3s ease-out;
}

/* 滚动条样式 */
.form-textarea::-webkit-scrollbar {
  width: 6px;
}

.form-textarea::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.form-textarea::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.form-textarea::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}