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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f7fafc;
  color: #2d3748;
  line-height: 1.6;
}

/* 桌面端布局 */
.desktop-layout {
  display: flex;
  max-width: 1200px;
  margin: 30px auto;
  gap: 30px;
}

.desktop-main {
  flex: 3;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.desktop-sidebar {
  flex: 1;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  padding: 20px;
}

@media (max-width: 768px) {
  .desktop-layout {
    display: none;
  }
}

/* 移动端布局 */
.mobile-layout {
  display: none;
  padding: 20px;
}

.mobile-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  padding: 0;
}

@media (max-width: 768px) {
  .mobile-layout {
    display: block;
  }
}

/* 公共样式 */
.board-header {
  padding: 20px 30px;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  border-radius: 12px 12px 0 0;
  text-align: center;
}

.board-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.board-header p {
  font-size: 0.9rem;
  opacity: 0.9;
}

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
  flex-wrap: wrap;
}

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

.stat-number {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  display: block;
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8);
}

.section-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2d3748;
  padding: 15px 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.messages-content {
  padding: 20px 30px;
}

.messages-list {
  max-height: 600px;
  overflow-y: auto;
  padding-right: 10px;
}

.messages-list::-webkit-scrollbar {
  width: 6px;
}

.messages-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.messages-list::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

.messages-list::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

.message-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.message-item:hover {
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.message-user {
  display: flex;
  align-items: center;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-right: 10px;
  border: 2px solid #4facfe;
}

.user-name {
  font-weight: 600;
  color: #2d3748;
  font-size: 0.9rem;
}

.message-time {
  color: #718096;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.message-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #4a5568;
  margin-bottom: 12px;
  word-wrap: break-word;
}

.message-actions {
  display: flex;
  gap: 15px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.action-btn {
  background: none;
  border: none;
  color: #718096;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-btn:hover {
  background: #f7fafc;
  color: #4facfe;
}

.action-btn.liked {
  color: #e53e3e;
}

.action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.replies-list {
  margin-top: 15px;
  padding-left: 20px;
  border-left: 3px solid #e2e8f0;
  background: #fafbfc;
  border-radius: 0 8px 8px 0;
}

.reply-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  margin: 10px 0;
  position: relative;
}

.reply-item::before {
  content: '';
  position: absolute;
  left: -23px;
  top: 20px;
  width: 16px;
  height: 2px;
  background: #cbd5e0;
}

.reply-item .message-header {
  margin-bottom: 8px;
}

.reply-item .user-avatar {
  width: 28px;
  height: 28px;
}

.reply-item .message-text {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.pending-message {
  background: #fff3cd !important;
  border: 2px dashed #4facfe !important;
  opacity: 0.8;
}

.pending-status {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  color: #856404;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-container {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination a, .pagination span {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  text-decoration: none;
  color: #4a5568;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  cursor: pointer;
  background: white;
}

.pagination a:hover {
  background: #4facfe;
  color: white;
  border-color: #4facfe;
}

.pagination .current {
  background: #4facfe;
  color: white;
  border-color: #4facfe;
}

.pagination .disabled {
  color: #cbd5e0;
  cursor: not-allowed;
}

/* 侧边栏样式 */
.sidebar-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-stats {
  margin-bottom: 20px;
}

.sidebar-stats .stat-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}

.sidebar-stats .stat-number {
  color: #4facfe;
}

.sidebar-post .current-user {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.sidebar-post .user-avatar {
  width: 40px;
  height: 40px;
}

.message-input {
  width: 100%;
  min-height: 80px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.9rem;
  resize: vertical;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

.message-input:focus {
  outline: none;
  border-color: #4facfe;
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.message-input::placeholder {
  color: #a0aec0;
}

.input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.emoji-bar {
  display: flex;
  gap: 8px;
}

.emoji-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.emoji-btn:hover {
  background: #e2e8f0;
  transform: scale(1.1);
}

.submit-btn {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(79, 172, 254, 0.3);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 移动端输入弹窗 */
.input-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.input-overlay.active {
  display: block;
  opacity: 1;
}

.input-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 500px;
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 1002;
  border: 1px solid #e2e8f0;
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.input-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2d3748;
}

.close-btn {
  background: none;
  border: none;
  color: #718096;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
}

.close-btn:hover {
  background: #e2e8f0;
}

.input-body .current-user {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.input-body .user-avatar {
  width: 40px;
  height: 40px;
}

/* 移动端发表按钮 */
.post-trigger {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(79, 172, 254, 0.4);
  transition: all 0.3s ease;
  z-index: 999;
  color: white;
  font-size: 1.5rem;
  border: none;
}

.post-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(79, 172, 254, 0.5);
}

/* 加载和空状态 */
.loading {
  text-align: center;
  padding: 40px 20px;
  color: #718096;
}

.loading i {
  font-size: 2rem;
  margin-bottom: 10px;
  animation: comment-spin 1s linear infinite;
}

@keyframes comment-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #718096;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #4a5568;
}

@keyframes comment-fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.new-message {
  animation: comment-fadeIn 0.5s ease;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .messages-content {
    padding: 15px 20px;
  }

  .section-title {
    padding: 10px 20px;
  }

  .message-item {
    padding: 15px;
  }

  .pagination a, .pagination span {
    padding: 5px 8px;
    font-size: 0.8rem;
  }
}