/* ============================================================
   川渝好门户 - 论坛页面样式
   ============================================================ */

.forum-wrap { max-width: var(--cy-container); margin: 0 auto; padding: var(--cy-space-5) var(--cy-space-4); }

/* 论坛页面头部 */
.forum-page-header {
  background: linear-gradient(135deg, var(--cy-primary), var(--cy-primary-light));
  border-radius: var(--cy-radius-lg);
  padding: var(--cy-space-8) var(--cy-space-6);
  margin-bottom: var(--cy-space-6);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.forum-page-header::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.15), transparent 70%);
  border-radius: 50%;
}
.forum-page-header h1 { margin: 0 0 var(--cy-space-2); font-size: var(--cy-text-3xl); font-weight: 800; }
.forum-page-header p { margin: 0; opacity: 0.9; font-size: var(--cy-text-base); }
.forum-page-stats {
  display: flex;
  gap: var(--cy-space-6);
  margin-top: var(--cy-space-5);
  position: relative;
  z-index: 1;
}
.forum-page-stat { text-align: center; }
.forum-page-stat strong { display: block; font-size: var(--cy-text-2xl); font-weight: 800; }
.forum-page-stat span { font-size: var(--cy-text-sm); opacity: 0.85; }

/* 板块分组 */
.forum-group {
  background: var(--cy-bg-card);
  border: 1px solid var(--cy-border);
  border-radius: var(--cy-radius);
  margin-bottom: var(--cy-space-5);
  overflow: hidden;
}
.forum-group-header {
  padding: var(--cy-space-4) var(--cy-space-5);
  background: var(--cy-gray-50);
  border-bottom: 1px solid var(--cy-border);
  font-weight: 700;
  font-size: var(--cy-text-base);
  display: flex;
  align-items: center;
  gap: var(--cy-space-2);
}
.forum-group-header .fg-icon { font-size: 18px; }

/* 板块列表 */
.forum-list { list-style: none; padding: 0; margin: 0; }
.forum-item {
  display: flex;
  align-items: center;
  gap: var(--cy-space-4);
  padding: var(--cy-space-4) var(--cy-space-5);
  border-bottom: 1px solid var(--cy-border);
  transition: var(--cy-transition);
}
.forum-item:last-child { border-bottom: none; }
.forum-item:hover { background: var(--cy-bg-hover); }
.forum-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--cy-radius);
  background: var(--cy-primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.forum-info { flex: 1; min-width: 0; }
.forum-name {
  font-size: var(--cy-text-base);
  font-weight: 600;
  color: var(--cy-text);
  text-decoration: none;
}
.forum-name:hover { color: var(--cy-primary); }
.forum-desc {
  font-size: var(--cy-text-sm);
  color: var(--cy-text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.forum-stats {
  display: flex;
  gap: var(--cy-space-5);
  flex-shrink: 0;
}
.forum-stat { text-align: center; min-width: 50px; }
.forum-stat strong { display: block; font-size: var(--cy-text-base); font-weight: 700; color: var(--cy-text); }
.forum-stat span { font-size: var(--cy-text-xs); color: var(--cy-text-muted); }
.forum-lastpost {
  font-size: var(--cy-text-xs);
  color: var(--cy-text-muted);
  min-width: 160px;
  text-align: right;
  flex-shrink: 0;
}
.forum-lastpost a { color: var(--cy-text-secondary); }
.forum-lastpost a:hover { color: var(--cy-primary); }

/* 帖子列表 (forumdisplay) */
.thread-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--cy-space-4) var(--cy-space-5);
  background: var(--cy-bg-card);
  border: 1px solid var(--cy-border);
  border-radius: var(--cy-radius) var(--cy-radius) 0 0;
  border-bottom: none;
}
.thread-toolbar-left { display: flex; gap: var(--cy-space-2); align-items: center; }
.thread-toolbar-right { display: flex; gap: var(--cy-space-2); }

.thread-table {
  background: var(--cy-bg-card);
  border: 1px solid var(--cy-border);
  border-radius: 0 0 var(--cy-radius) var(--cy-radius);
  overflow: hidden;
}
.thread-row {
  display: flex;
  align-items: center;
  gap: var(--cy-space-3);
  padding: var(--cy-space-3) var(--cy-space-5);
  border-bottom: 1px solid var(--cy-border);
  transition: var(--cy-transition);
}
.thread-row:last-child { border-bottom: none; }
.thread-row:hover { background: var(--cy-bg-hover); }
.thread-row.sticky { background: #fffbf5; }
.thread-row.digest { background: #f6fff8; }
.thread-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.thread-avatar img { width: 100%; height: 100%; object-fit: cover; }
.thread-main { flex: 1; min-width: 0; }
.thread-subject {
  font-size: var(--cy-text-base);
  color: var(--cy-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--cy-space-2);
}
.thread-subject:hover { color: var(--cy-primary); }
.thread-subject .icon-top { color: var(--cy-primary); font-size: var(--cy-text-sm); }
.thread-subject .icon-digest { color: var(--cy-gold); font-size: var(--cy-text-sm); }
.thread-meta {
  font-size: var(--cy-text-xs);
  color: var(--cy-text-muted);
  margin-top: 2px;
}
.thread-meta a { color: var(--cy-text-muted); }
.thread-meta a:hover { color: var(--cy-primary); }
.thread-nums {
  display: flex;
  gap: var(--cy-space-4);
  flex-shrink: 0;
  font-size: var(--cy-text-sm);
  color: var(--cy-text-muted);
}
.thread-nums .replies { font-weight: 600; color: var(--cy-text-secondary); }
.thread-nums .views { min-width: 50px; text-align: right; }
.thread-last {
  font-size: var(--cy-text-xs);
  color: var(--cy-text-muted);
  min-width: 120px;
  text-align: right;
  flex-shrink: 0;
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--cy-space-2);
  padding: var(--cy-space-3) 0;
  font-size: var(--cy-text-sm);
  color: var(--cy-text-muted);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--cy-text-secondary); }
.breadcrumb a:hover { color: var(--cy-primary); }
.breadcrumb .sep { color: var(--cy-gray-400); }

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--cy-space-1);
  padding: var(--cy-space-5);
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 var(--cy-space-3);
  border: 1px solid var(--cy-border);
  border-radius: var(--cy-radius-sm);
  font-size: var(--cy-text-sm);
  color: var(--cy-text-secondary);
  text-decoration: none;
  transition: var(--cy-transition);
}
.pagination a:hover { border-color: var(--cy-primary); color: var(--cy-primary); }
.pagination .active {
  background: var(--cy-primary);
  border-color: var(--cy-primary);
  color: #fff;
}

/* ========== 帖子阅读页 viewthread ========== */
.viewthread-wrap { max-width: var(--cy-container); margin: 0 auto; padding: var(--cy-space-4); }

.post-list { display: flex; flex-direction: column; gap: var(--cy-space-4); }
.post-card {
  background: var(--cy-bg-card);
  border: 1px solid var(--cy-border);
  border-radius: var(--cy-radius);
  overflow: hidden;
}
.post-header {
  display: flex;
  align-items: center;
  gap: var(--cy-space-3);
  padding: var(--cy-space-4) var(--cy-space-5);
  background: var(--cy-gray-50);
  border-bottom: 1px solid var(--cy-border);
}
.post-floor {
  font-size: var(--cy-text-sm);
  color: var(--cy-text-muted);
  font-weight: 600;
}
.post-user-info { display: flex; align-items: center; gap: var(--cy-space-2); }
.post-user-info a { font-weight: 600; color: var(--cy-text); }
.post-user-info a:hover { color: var(--cy-primary); }
.post-date { margin-left: auto; font-size: var(--cy-text-sm); color: var(--cy-text-muted); }

.post-body {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0;
}
.post-sidebar {
  padding: var(--cy-space-5);
  background: var(--cy-gray-50);
  border-right: 1px solid var(--cy-border);
  text-align: center;
}
.post-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto var(--cy-space-3);
  border: 3px solid #fff;
  box-shadow: var(--cy-shadow-sm);
}
.post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-username { font-weight: 700; font-size: var(--cy-text-base); margin-bottom: 4px; }
.post-usertitle { font-size: var(--cy-text-xs); color: var(--cy-text-muted); margin-bottom: var(--cy-space-2); }
.post-userstats { font-size: var(--cy-text-xs); color: var(--cy-text-muted); }

.post-content {
  padding: var(--cy-space-5);
  font-size: var(--cy-text-base);
  line-height: 1.8;
  color: var(--cy-text);
  min-height: 120px;
}
.post-content img { max-width: 100%; height: auto; border-radius: var(--cy-radius-sm); }
.post-content p { margin: 0 0 var(--cy-space-3); }

.post-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--cy-space-2);
  padding: var(--cy-space-3) var(--cy-space-5);
  border-top: 1px solid var(--cy-border);
  background: var(--cy-gray-50);
}
.post-action {
  padding: 4px 12px;
  font-size: var(--cy-text-sm);
  color: var(--cy-text-muted);
  border-radius: var(--cy-radius-sm);
  cursor: pointer;
  transition: var(--cy-transition);
  text-decoration: none;
}
.post-action:hover { background: var(--cy-bg-hover); color: var(--cy-primary); }

/* 帖子标题区 */
.thread-title-bar {
  background: var(--cy-bg-card);
  border: 1px solid var(--cy-border);
  border-radius: var(--cy-radius);
  padding: var(--cy-space-5);
  margin-bottom: var(--cy-space-4);
}
.thread-title-bar h1 {
  margin: 0 0 var(--cy-space-3);
  font-size: var(--cy-text-2xl);
  font-weight: 700;
  line-height: 1.4;
}
.thread-title-meta {
  display: flex;
  align-items: center;
  gap: var(--cy-space-4);
  font-size: var(--cy-text-sm);
  color: var(--cy-text-muted);
  flex-wrap: wrap;
}

/* 响应式 */
@media (max-width: 768px) {
  .forum-wrap { padding: var(--cy-space-3); }
  .forum-page-header { padding: var(--cy-space-6) var(--cy-space-4); }
  .forum-page-header h1 { font-size: var(--cy-text-xl); }
  .forum-page-stats { gap: var(--cy-space-4); }
  .forum-item { flex-wrap: wrap; padding: var(--cy-space-3); gap: var(--cy-space-2); }
  .forum-stats { display: none; }
  .forum-lastpost { display: none; }
  .forum-desc { display: none; }
  .thread-row { padding: var(--cy-space-3); flex-wrap: wrap; }
  .thread-avatar { width: 32px; height: 32px; }
  .thread-nums { gap: var(--cy-space-3); }
  .thread-nums .views { display: none; }
  .thread-last { display: none; }
  .post-body { grid-template-columns: 1fr; }
  .post-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--cy-border);
    display: flex;
    align-items: center;
    gap: var(--cy-space-3);
    text-align: left;
    padding: var(--cy-space-3) var(--cy-space-4);
  }
  .post-avatar { width: 40px; height: 40px; margin: 0; }
  .post-sidebar > div { flex: 1; }
  .thread-title-bar h1 { font-size: var(--cy-text-xl); }
}
