/* 社交分享页面样式 - 朋友圈风格 */

/* 全局样式重置 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* Community Header 样式 */
.community-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.community-header .header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 70px;
}

.community-header .header-brand {
  flex-shrink: 0;
}

.community-header .brand-link {
  text-decoration: none;
  color: inherit;
}

.community-header .brand-title {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  transition: transform 0.2s ease;
}

.community-header .brand-link:hover .brand-title {
  transform: scale(1.02);
}

.community-header .header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.community-header .nav-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.community-header .nav-user {
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.community-header .mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
}

.community-header .mobile-menu-toggle:hover {
  background-color: rgba(102, 126, 234, 0.1);
}

.community-header .hamburger-line {
  width: 20px;
  height: 2px;
  background-color: #333;
  margin: 2px 0;
  transition: all 0.3s ease;
  border-radius: 1px;
}

.community-header .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.community-header .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.community-header .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* 主容器 */
.social-container {
  max-width: 600px;
  margin: 0 auto;
  background-color: #fff;
  min-height: 100vh;
}

/* 头部区域 */
.social-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem 1rem;
  text-align: center;
}

.header-content h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.header-description {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 1rem;
}



/* 发帖编辑器 */
.post-composer {
  background: white;
  border-bottom: 1px solid #e1e8ed;
  padding: 1rem;
}

.composer-content textarea {
  width: 100%;
  min-height: 80px;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 1rem;
  resize: vertical;
  font-family: inherit;
}

.composer-content textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}

.btn-image {
  background: none;
  border: 1px solid #e1e8ed;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #666;
  transition: all 0.2s;
}

.btn-image:hover {
  background-color: #f8f9fa;
  border-color: #667eea;
}

.btn-post {
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-post:hover {
  background: #5a6fd8;
}

.image-preview {
  margin-top: 10px;
  padding: 15px;
  border: 1px solid #e1e8ed;
  border-radius: 12px;
  background: #f8f9fa;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.image-preview::-webkit-scrollbar {
  width: 6px;
}

.image-preview::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.image-preview::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.image-preview::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 图片容器样式 */
.image-preview .image-container {
  position: relative;
  display: inline-block;
  margin: 5px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-preview .image-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.image-preview .image-container img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: none;
  display: block;
}

.image-preview .image-container .delete-btn {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff4757;
  color: white;
  border: 2px solid white;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.image-preview .image-container .delete-btn:hover {
  background: #ff3742;
  transform: scale(1.1);
}

/* 处理进度样式 */
.image-preview .processing-indicator {
  text-align: center;
  padding: 20px;
  color: #666;
  font-size: 14px;
}

.image-preview .processing-indicator::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.image-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e1e8ed;
}

/* 帖子流 */
.posts-feed {
  background: white;
}

/* 帖子卡片 */
.post-card {
  border-bottom: 1px solid #e1e8ed;
  padding: 1rem;
  transition: background-color 0.2s;
}

.post-card:hover {
  background-color: #fafbfc;
}

/* 帖子头部 */
.post-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

/* 圆形头像样式 */
.user-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.author-avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-avatar-circle:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 0.75rem;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info {
  flex: 1;
}

.username {
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
  display: none; /* 隐藏用户名显示 */
}

.post-time {
  font-size: 0.8rem;
  color: #666;
}

.post-menu {
  margin-left: auto;
}

.menu-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #666;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.menu-btn:hover {
  background-color: #f0f0f0;
}

/* 帖子内容 */
.post-content {
  margin-bottom: 0.75rem;
}

.post-text {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* 图片展示 */
.post-images {
  margin-top: 0.75rem;
}

.post-images.single-image {
  max-width: 400px;
}

.post-images.single-image .image-container {
  width: 100%;
}

.post-images.multiple-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  max-width: 300px;
}

.image-container {
  position: relative;
  width: 100%;
  max-width: 640px;
  height: 360px;
  overflow: hidden;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: pointer;
  transition: transform 0.2s;
}

.image-container img:hover {
  transform: scale(1.02);
}

/* 帖子操作按钮 */
.post-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f0f0f0;
}

.action-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #666;
  transition: all 0.2s;
}

/* 固定登出按钮尺寸，避免受到全局 .btn 样式影响 */
#logout-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  padding: 8px 16px !important;
  font-size: 14px !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

#logout-btn:hover {
  transform: translateY(-1px);
}

.action-btn:hover {
  background-color: #f8f9fa;
}

.action-btn.liked {
  color: #e91e63;
}

.action-btn .icon {
  font-size: 1rem;
}

.action-btn .count {
  font-weight: 500;
}

/* 导航菜单内的通用按钮避免受全局 .btn 宽度规则影响 */
.community-header .nav-menu .btn {
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto !important;
}

/* 评论区域 */
.comments-section {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f0f0f0;
}

.comments-list {
  margin-bottom: 0.75rem;
}

/* 评论项 */
.comment-item {
  display: flex;
  margin-bottom: 0.75rem;
}

.comment-item.comment-reply {
  margin-left: 2rem;
  margin-top: 0.5rem;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-content {
  flex: 1;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.comment-username {
  font-weight: 600;
  font-size: 0.85rem;
  color: #333;
}

.comment-time {
  font-size: 0.75rem;
  color: #666;
}

.comment-text {
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  word-wrap: break-word;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.comment-like-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #666;
  transition: all 0.2s;
}

.comment-like-btn:hover {
  background-color: #f8f9fa;
}

.comment-like-btn.liked {
  color: #e91e63;
}

.comment-reply-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.comment-reply-btn:hover {
  background-color: #f8f9fa;
  color: #667eea;
}

/* 评论输入 */
.comment-input, .reply-input {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.comment-field, .reply-field {
  flex: 1;
  border: 1px solid #e1e8ed;
  border-radius: 20px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-family: inherit;
}

.comment-field:focus, .reply-field:focus {
  outline: none;
  border-color: #667eea;
}

.comment-submit, .reply-submit {
  background: #667eea;
  color: white;
  border: none;
  border-radius: 16px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.comment-submit:hover, .reply-submit:hover {
  background: #5a6fd8;
}

/* 回复容器 */
.replies-container {
  margin-left: 2rem;
  margin-top: 0.5rem;
}

.reply-input {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

/* 加载更多 */
.load-more {
  text-align: center;
  padding: 2rem 1rem;
  background: white;
}

.btn-load-more {
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 2rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-load-more:hover {
  background: #5a6fd8;
}

/* 单个帖子页面 */
.post-page-header {
  background: white;
  padding: 1rem;
  border-bottom: 1px solid #e1e8ed;
}

.btn-back {
  color: #667eea;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.2s;
}

.btn-back:hover {
  color: #5a6fd8;
}

/* 错误消息 */
.error-message {
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
}

.error-message h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #333;
}

.error-message p {
  margin-bottom: 1.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .social-container {
    max-width: 100%;
  }
  
  .social-header {
    padding: 1.5rem 1rem;
  }
  
  .header-content h1 {
    font-size: 1.5rem;
  }
  
  .post-card {
    padding: 0.75rem;
  }
  
  .post-images.multiple-images {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .comment-item.comment-reply {
    margin-left: 1rem;
  }
  
  .replies-container {
    margin-left: 1rem;
  }
  
  /* 社区页面导航菜单在小屏幕下保持可见 */
  .community-header .header-container {
    padding: 0.75rem 1rem;
  }
  
  .community-header .brand-title {
    font-size: 1.1rem;
  }
  
  .community-header .nav-menu {
    gap: 0.75rem;
  }
}

/* 针对9:16宽高比（手机竖屏）的特殊优化 */
@media (max-width: 414px) and (min-height: 736px) {
  .community-header .header-container {
    padding: 0.75rem 1rem;
  }
  
  .community-header .brand-title {
    font-size: 1rem;
  }
  
  .community-header .nav-menu {
    gap: 0.5rem;
  }
  
  .community-header .mobile-menu-toggle {
    display: block;
  }
}

@media (max-width: 480px) {
  .social-header {
    padding: 1rem;
  }
  
  .header-content h1 {
    font-size: 1.3rem;
  }

  
  .composer-actions {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  
  .post-actions {
    gap: 0.5rem;
  }
  
  .action-btn {
    padding: 0.4rem;
    font-size: 0.8rem;
  }
  
  /* 社区页面导航在超小屏幕下的优化 */
  .community-header .header-container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }
  
  .community-header .header-brand {
    text-align: left;
    flex: 1;
  }
  
  .community-header .brand-title {
    font-size: 0.95rem;
  }
  
  .community-header .nav-menu {
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }
  
  .community-header .mobile-menu-toggle {
    display: none;
  }
}

/* 图片弹窗样式 */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.image-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.image-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.image-modal-close {
  position: absolute;
  top: -15px;
  right: -15px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  color: #333;
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.image-modal-close:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 动画效果 */
.post-card {
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 加载状态 */
.loading {
  text-align: center;
  padding: 2rem;
  color: #666;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #e1e8ed;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 0.5rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 登录弹窗样式 */
.login-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.login-modal {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  animation: modalSlideIn 0.3s ease-out forwards;
}

@keyframes modalSlideIn {
  from {
    transform: scale(0.9) translateY(-20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.login-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 2rem 1rem 2rem;
  border-bottom: 1px solid #f0f0f0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 16px 16px 0 0;
}

.login-modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
}

.close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: white;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.login-modal-body {
  padding: 2rem;
}

.login-tabs {
  display: flex;
  margin-bottom: 2rem;
  background: #f8f9fa;
  border-radius: 12px;
  padding: 4px;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  color: #666;
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: 500;
}

.tab-btn.active {
  background: white;
  color: #667eea;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tab-btn:hover {
  color: #667eea;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group input {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e1e8ed;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.2s;
  background: #fafbfc;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: white;
}

.form-group input::placeholder {
  color: #999;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.5rem;
  display: inline-block;
  min-width: 120px;
  max-width: 200px;
  text-align: center;
}

/* 全宽按钮变体 - 用于表单提交等需要全宽的场景 */
.btn-primary.btn-full-width {
  width: 100%;
  max-width: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.login-message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
}

.login-message.error {
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
}

.login-message.success {
  background: #efe;
  color: #363;
  border: 1px solid #cfc;
}

/* Toast 提示框样式 */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease-out;
  font-size: 14px;
  max-width: 300px;
  word-wrap: break-word;
  pointer-events: auto; /* 允许点击关闭 */
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success {
  background: linear-gradient(135deg, #4CAF50, #45a049);
}

.toast.error {
  background: linear-gradient(135deg, #f44336, #d32f2f);
}

.toast.warning {
  background: linear-gradient(135deg, #ff9800, #f57c00);
}

.toast.info {
  background: linear-gradient(135deg, #2196F3, #1976D2);
}

/* 认证模态框样式 */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.auth-modal-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

/* Supabase Auth UI 样式覆盖 */
.auth-modal-content .supabase-auth-ui_ui {
  font-family: inherit;
}

.auth-modal-content .supabase-auth-ui_ui button {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.auth-modal-content .supabase-auth-ui_ui button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 自定义认证界面样式 */
.auth-modal-content h2 {
  margin: 0 0 1.5rem 0;
  color: #333;
  font-size: 1.5rem;
  font-weight: 600;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

#close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

#close-modal:hover {
  background-color: #f5f5f5;
  color: #333;
}

.auth-tabs {
  display: flex;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.auth-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: #666;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.auth-tab:hover {
  color: #333;
  background-color: #f8f9fa;
}

.auth-tab.active {
  color: #007bff;
  border-bottom-color: #007bff;
  background-color: #f8f9fa;
}

#auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#auth-form input {
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background-color: #fff;
}

#auth-form input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#auth-form input:hover {
  border-color: #b0b0b0;
}

#auth-submit {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

#auth-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #0056b3, #004085);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

#auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#auth-message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  text-align: center;
  min-height: 20px;
}

#auth-message:not(:empty) {
  border: 1px solid;
}

#confirm-password-container {
  display: none;
}

#confirm-password-container input {
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background-color: #fff;
}

#confirm-password-container input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#confirm-password-container input:hover {
  border-color: #b0b0b0;
}

/* 响应式设计 */
@media (max-width: 480px) {
  .auth-modal-content {
    padding: 1.5rem;
    margin: 1rem;
    width: calc(100% - 2rem);
  }
  
  .auth-modal-header h2 {
    font-size: 1.25rem;
  }
  
  .auth-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
}

.auth-modal-content .supabase-auth-ui_ui input {
  border-radius: 8px;
  border: 1px solid #e1e8ed;
  padding: 0.75rem;
  font-size: 1rem;
}

.auth-modal-content .supabase-auth-ui_ui input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 点赞按钮样式 */
.like-button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #666;
  transition: all 0.2s ease;
  text-decoration: none;
}

.like-button:hover {
  background-color: rgba(233, 30, 99, 0.1);
  color: #e91e63;
}

.like-button.liked {
  color: #e91e63;
  animation: likeAnimation 0.3s ease;
}

.like-button .like-icon {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.like-button:hover .like-icon {
  transform: scale(1.1);
}

.like-button.liked .like-icon {
  transform: scale(1.2);
}

.like-count {
  font-weight: 500;
  min-width: 1rem;
  text-align: left;
}

@keyframes likeAnimation {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* 帖子统计区域样式优化 */
.post-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid #f0f0f0;
  margin-top: 0.75rem;
}

/* 评论按钮样式 */
.comment-button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #666;
  transition: all 0.2s ease;
}

.comment-button:hover {
  background-color: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

.comment-button .comment-icon {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.comment-button:hover .comment-icon {
  transform: scale(1.1);
}

.comment-count {
  font-weight: 500;
  min-width: 1rem;
  text-align: left;
}

/* 评论输入容器样式 */
.comment-input-container {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e1e8ed;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.comment-input-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.comment-user-avatar {
  flex-shrink: 0;
}

.comment-user-avatar .user-avatar-circle {
  width: 36px;
  height: 36px;
  font-size: 0.8rem;
}

.comment-input-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  background-color: white;
  transition: all 0.2s ease;
}

.comment-textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.comment-input-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn-cancel-comment,
.btn-submit-comment {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel-comment {
  background-color: transparent;
  color: #666;
  border: 1px solid #e1e8ed;
}

.btn-cancel-comment:hover {
  background-color: #f0f0f0;
  border-color: #d0d0d0;
}

.btn-submit-comment {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-submit-comment:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-submit-comment:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 响应式设计 - 评论输入框 */
@media (max-width: 480px) {
  .comment-input-wrapper {
    gap: 0.5rem;
  }
  
  .comment-user-avatar .user-avatar-circle {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
  
  .comment-textarea {
    font-size: 0.9rem;
    min-height: 70px;
  }
  
  .comment-input-actions {
    flex-direction: column;
  }
  
  .btn-cancel-comment,
  .btn-submit-comment {
    width: 100%;
  }
}

/* Google OAuth 登录按钮样式 */
.btn-google:hover:not(:disabled) {
  background: #f8f8f8 !important;
  border-color: #ccc !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.btn-google:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.btn-google:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.oauth-divider {
  margin: 20px 0;
  text-align: center;
  color: #666;
  position: relative;
  font-size: 14px;
}

.oauth-divider::before,
.oauth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: #e1e8ed;
}

.oauth-divider::before {
  left: 0;
}

.oauth-divider::after {
  right: 0;
}

.oauth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  background: white;
  color: #333;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 12px;
}

.oauth-btn:hover:not(:disabled) {
  border-color: #d1d5db;
  background: #f9fafb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.oauth-btn:active {
  transform: translateY(0);
}

.oauth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.oauth-btn svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}
