/* forum.css — 原始子 Agent 版本 */

/* Hero Section */
.forum-hero {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  padding: 6rem 1rem 3.5rem;
  margin-top: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.forum-hero .section-title {
  color: var(--color-bg-white) !important;
  font-size: 3rem;
  font-family: var(--font-heading);
  margin-bottom: 0.5rem;
}

.forum-hero .section-subtitle {
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 1.15rem;
}

.forum-container {
  max-width: 800px;
  margin: 0 auto;
}

.forum-main {
  padding-top: 2rem;
  padding-bottom: 4rem;
  background: var(--color-bg);
}

/* Categories */
.forum-categories {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 1rem 0;
  margin-bottom: 1.5rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
}
.forum-categories::-webkit-scrollbar {
  display: none;
}

.category-tab {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-bg-white);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-tab:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary-light);
  transform: translateY(-1px);
}

.category-tab.active {
  background: var(--color-primary);
  color: var(--color-bg-white) !important;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* Create Post Area */
.create-post-area {
  background: var(--color-bg-white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.create-post-placeholder {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
  background: var(--color-bg);
}
.create-post-placeholder:hover {
  background-color: #f0e6da;
}

.post-author-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.placeholder-avatar {
  background: var(--color-border);
  color: var(--color-text-muted);
}

.placeholder-text {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  flex: 1;
}

.create-post-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-input {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg-white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  resize: vertical;
  box-sizing: border-box;
}
.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.form-select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg-white);
  cursor: pointer;
  outline: none;
}
.form-select:focus {
  border-color: var(--color-primary);
}

.btn-group {
  display: flex;
  gap: 0.75rem;
}

/* Post List & Cards */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-card {
  background: var(--color-bg-white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.post-author-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-author-name {
  font-weight: 600;
  color: var(--color-text);
  font-size: 1rem;
}

.post-time {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.1rem;
}

.post-badge {
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-recipes { background: #E8F5E9; color: #2E7D32; }
.badge-nutrition { background: #E3F2FD; color: #1565C0; }
.badge-productreviews { background: #FFF3E0; color: #E65100; }
.badge-tipstricks { background: #F3E5F5; color: #6A1B9A; }

.post-body {
  cursor: pointer;
}

.post-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--color-text);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.post-preview {
  color: var(--color-text-light);
  line-height: 1.6;
  font-size: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.post-actions {
  display: flex;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.action-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.action-btn:hover {
  color: var(--color-primary);
}
.action-btn:active {
  transform: scale(0.95);
}
.like-btn.liked {
  color: var(--color-strawberry);
}
.post-liked .like-btn {
  color: var(--color-strawberry);
}

/* Modal */
.post-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}
.post-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(62, 39, 35, 0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: var(--color-bg-white);
  width: 90%;
  max-width: 680px;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.98);
  transition: transform var(--transition-base);
}
.post-modal.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: var(--color-bg);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.modal-close:hover {
  color: var(--color-text);
  background: var(--color-border);
}

/* Comments Section */
.comments-section {
  margin-top: 2rem;
}
.comments-section h3 {
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
  color: var(--color-text);
  font-family: var(--font-heading);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.comment-item {
  display: flex;
  gap: 1rem;
  background: var(--color-bg);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.comment-content {
  flex: 1;
}

.comment-author {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  color: var(--color-text);
}

.comment-text {
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

.comment-input-area {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--color-bg);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

/* Responsive */
@media (max-width: 768px) {
  .forum-hero {
    padding: 5rem 1rem 3rem;
  }
  .forum-hero .section-title {
    font-size: 2.25rem;
  }
  .modal-content {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    padding: 1.5rem;
    padding-top: 4rem;
  }
}
