/* 晶体矿物学习平台 - 社区互动样式 */

/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Source Han Sans CN", "PingFang SC", sans-serif;
  font-size: 14px;
  color: #333333;
  background-color: #F5F8FC;
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: #2A5DAA;
}

ul, li {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* 社区布局 */
.community-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
}

/* 通用卡片样式 */
.card {
  background: #FFFFFF;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 24px;
}

/* 帖子列表样式 */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-item {
  background: #FFFFFF;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s;
}

.post-item:hover {
  transform: translateY(-4px);
}

.post-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.post-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 12px;
}

.post-meta {
  flex: 1;
}

.post-author {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
}

.post-time {
  color: #999999;
  font-size: 12px;
}

.post-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 12px;
  color: #333333;
}

.post-content {
  font-size: 14px;
  color: #666666;
  margin-bottom: 16px;
  line-height: 1.6;
}

.post-footer {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* 帖子操作按钮区 */
.post-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid #EEEEEE;
}

/* 帖子列表中的操作链接 */
.post-action {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #666666;
  font-size: 14px;
  transition: color 0.3s;
}

.post-action:hover {
  color: #2A5DAA;
}

.post-action i {
  font-size: 16px;
}

/* 操作按钮通用样式 */
.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #666666;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  background-color: #F5F8FC;
  border: 1px solid #E8EEF7;
  transition: all 0.2s ease;
}

.action-btn:hover {
  color: #2A5DAA;
  background-color: #EEF3FB;
  border-color: #D0E0F7;
  transform: translateY(-2px);
}

.action-btn.active {
  color: #2A5DAA;
  background-color: #EEF3FB;
  border-color: #2A5DAA;
  font-weight: 500;
}

.action-btn i {
  font-size: 16px;
}

/* 评论区整体样式 */
.comments-section {
  margin-top: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  background-color: #FFFFFF;
  padding: 24px;
}

.comments-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #333333;
  padding-bottom: 10px;
  border-bottom: 1px solid #EEEEEE;
}

/* 评论表单样式 */
.comment-form {
  display: flex;
  gap: 16px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #F0F0F0;
}

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

.comment-input-wrapper {
  flex: 1;
  position: relative;
}

.comment-input {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid #EEEEEE;
  border-radius: 6px;
  font-size: 14px;
  resize: vertical;
  transition: border-color 0.3s;
}

.comment-input:focus {
  outline: none;
  border-color: #2A5DAA;
  box-shadow: 0 0 0 2px rgba(42, 93, 170, 0.1);
}

.comment-submit {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 6px 16px;
  background-color: #2A5DAA;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 6px rgba(42, 93, 170, 0.25);
}

.comment-submit:hover {
  background-color: #1E4785;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(42, 93, 170, 0.3);
}

/* 评论列表样式 */
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.comment-item {
  display: flex;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid #F0F0F0;
}

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

.comment-content {
  flex: 1;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.comment-author {
  font-weight: 600;
  color: #333333;
  font-size: 15px;
}

.comment-time {
  color: #999999;
  font-size: 12px;
}

.comment-text {
  font-size: 14px;
  line-height: 1.6;
  color: #333333;
  margin-bottom: 12px;
}

.comment-actions {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

/* 评论和回复中的操作按钮样式 */
.comment-actions .action-btn,
.reply-actions .action-btn {
  padding: 4px 8px;
  font-size: 13px;
  background-color: #F8F9FA;
  border: 1px solid #EAEEF4;
}

.comment-actions .action-btn i,
.reply-actions .action-btn i {
  font-size: 14px;
}

/* 回复表单样式 */
.reply-form {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #EEEEEE;
}

.reply-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.reply-input-wrapper {
  flex: 1;
  position: relative;
}

.reply-input {
  width: 100%;
  min-height: 60px;
  padding: 10px;
  border: 1px solid #EEEEEE;
  border-radius: 6px;
  font-size: 14px;
  resize: vertical;
  transition: border-color 0.3s;
}

.reply-input:focus {
  outline: none;
  border-color: #2A5DAA;
  box-shadow: 0 0 0 2px rgba(42, 93, 170, 0.1);
}

.reply-submit {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 4px 14px;
  background-color: #2A5DAA;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 4px rgba(42, 93, 170, 0.25);
}

.reply-submit:hover {
  background-color: #1E4785;
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(42, 93, 170, 0.3);
}

/* 回复列表样式 */
.reply-list {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #EEEEEE;
}

.reply-item {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #EEEEEE;
}

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

.reply-content {
  flex: 1;
}

.reply-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.reply-author {
  font-weight: 600;
  color: #333333;
  font-size: 14px;
}

.reply-time {
  color: #999999;
  font-size: 12px;
}

.reply-text {
  font-size: 13px;
  line-height: 1.6;
  color: #333333;
  margin-bottom: 8px;
}

.reply-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

/* 编辑器样式 */
.editor-container {
  background: #FFFFFF;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.editor-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 24px;
}

.comment-input {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid #E5E9EF;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 16px;
  background-color: #F8F9FA;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  resize: vertical;
  min-height: 120px;
  color: #333333;
  line-height: 1.6;
}

.comment-input:focus {
  outline: none;
  border-color: #2A5DAA;
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(42, 93, 170, 0.15);
  transform: translateY(-1px);
}

.editor-input:focus {
  border-color: #2A5DAA;
  outline: none;
}

.editor-textarea {
  width: 100%;
  height: 240px;
  padding: 12px;
  border: 1px solid #DDDDDD;
  border-radius: 4px;
  font-size: 14px;
  resize: vertical;
  margin-bottom: 16px;
  transition: border-color 0.3s;
}

.editor-textarea:focus {
  border-color: #2A5DAA;
  outline: none;
}

.editor-toolbar {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.toolbar-btn {
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.3s;
}

.toolbar-btn.primary {
  background-color: #2A5DAA;
  color: #FFFFFF;
}

.toolbar-btn.primary:hover {
  background-color: #4B8CD7;
}

.toolbar-btn.secondary {
  background-color: #F0F5FF;
  color: #2A5DAA;
}

.toolbar-btn.secondary:hover {
  background-color: #E0EAFF;
}

/* 用户主页样式 */
.profile-banner {
  height: 240px;
  background: linear-gradient(135deg, #2A5DAA 0%, #4B8CD7 100%);
  margin-bottom: 24px;
  border-radius: 8px;
  padding: 32px;
  color: #FFFFFF;
  display: flex;
  align-items: flex-end;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 24px;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid #FFFFFF;
}

.profile-meta {
  flex: 1;
}

.profile-name {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 8px;
}

.profile-bio {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 16px;
}

.profile-stats {
  display: flex;
  gap: 32px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  opacity: 0.8;
}

/* 消息通知样式 */
.message-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: background-color 0.3s;
}

.message-item:hover {
  background-color: #F8FAFD;
}

.message-item.unread {
  background-color: #F0F5FF;
}

.message-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}

.message-content {
  flex: 1;
}

.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.message-title {
  font-weight: bold;
  color: #333333;
}

.message-time {
  color: #999999;
  font-size: 12px;
}

.message-text {
  font-size: 14px;
  color: #666666;
  line-height: 1.6;
}

.message-actions {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.message-action {
  color: #2A5DAA;
  font-size: 14px;
  cursor: pointer;
}

.message-action:hover {
  text-decoration: underline;
}