/* =========================================================
   星环设计 - 热门发现页样式（discover.css）
   上半部分：热门帖子榜（排名 + 热度分）
   下半部分：用户榜单（积分 / 发帖 / 获赞，桌面三栏、手机单栏）
   颜色全部走主题变量，暗色自动适配。
   ========================================================= */

.dc-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* common.css 里没有 .card，发现页自带一份（forum.css 不引了） */
.dc-main .card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

/* ---------- 顶部：标题 + 时间范围 ---------- */
.dc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.dc-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.dc-title i { color: #f97316; margin-right: 6px; }
.dc-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}

.dc-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-hover);
}
.dc-tab {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.dc-tab:hover { color: var(--text); }
.dc-tab.active {
  background: var(--bg-card);
  color: var(--primary);
  font-weight: 600;
}

/* ---------- 区块通用 ---------- */
.dc-section { margin-bottom: 22px; }
.dc-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 2px 10px;
}
.dc-sec-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.dc-sec-title i { color: var(--primary); margin-right: 6px; }
.dc-sec-tip { font-size: 12px; color: var(--text-2); }

/* ---------- 热门帖子榜 ---------- */
.dc-hot { padding: 4px 0; overflow: hidden; }

.dc-post {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.dc-post:last-child { border-bottom: none; }
.dc-post:hover { background: var(--bg-hover); }

.dc-rank {
  flex: 0 0 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--bg-hover);
}
.dc-rank.r1 { background: rgba(245, 158, 11, 0.16); color: #d97706; }
.dc-rank.r2 { background: rgba(100, 116, 139, 0.16); color: #5b6b80; }
.dc-rank.r3 { background: rgba(180, 120, 70, 0.16);  color: #b0693b; }

.dc-post-main { flex: 1; min-width: 0; }

.dc-post-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}
.dc-post-content.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

.dc-post-imgs { display: flex; gap: 6px; margin-top: 8px; }
.dc-post-imgs img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: zoom-in;
}

.dc-post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 9px;
  font-size: 12px;
  color: var(--text-2);
}
.dc-author { display: inline-flex; align-items: center; gap: 6px; }
.dc-avatar,
.dc-avatar-fallback {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 20px;
}
.dc-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
}
.dc-author-name { color: var(--text); }
.dc-cat {
  padding: 1px 8px;
  border-radius: 20px;
  background: var(--bg-hover);
}
.dc-stats { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.dc-stats i { margin-right: 3px; }
.dc-hot-val { color: #f97316; font-weight: 600; }

/* ---------- 用户榜单 ---------- */
.dc-boards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: start;
}
.dc-board {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dc-board-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 13px 15px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.dc-board-head i { color: var(--primary); }
.dc-board-note {
  margin-left: auto;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-2);
}

.dc-board-list { padding: 5px 0; }

.dc-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.dc-user:hover { background: var(--bg-hover); }

.dc-user-rank {
  flex: 0 0 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}
.dc-user-rank.r1 { color: #d97706; }
.dc-user-rank.r2 { color: #5b6b80; }
.dc-user-rank.r3 { color: #b0693b; }

.dc-user-avatar,
.dc-user-fallback {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 30px;
}
.dc-user-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

.dc-user-info { flex: 1; min-width: 0; }
.dc-user-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
}
.dc-user-name .dc-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dc-user-sub {
  display: block;
  font-size: 11px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dc-user-val {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

/* ---------- 空态 / 加载态 ---------- */
.dc-empty,
.dc-loading {
  padding: 30px 18px;
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
}
.dc-empty i { margin-right: 5px; }

/* ---------- 暗色适配 ---------- */
[data-theme="dark"] .dc-rank.r1 { background: rgba(245, 158, 11, 0.22); color: #fbbf24; }
[data-theme="dark"] .dc-rank.r2 { background: rgba(148, 163, 184, 0.20); color: #cbd5e1; }
[data-theme="dark"] .dc-rank.r3 { background: rgba(180, 120, 70, 0.22);  color: #dda06c; }
[data-theme="dark"] .dc-user-rank.r1 { color: #fbbf24; }
[data-theme="dark"] .dc-user-rank.r2 { color: #cbd5e1; }
[data-theme="dark"] .dc-user-rank.r3 { color: #dda06c; }
[data-theme="dark"] .dc-hot-val { color: #fb923c; }
[data-theme="dark"] .dc-title i { color: #fb923c; }

/* ---------- 小屏：榜单改成单栏 ---------- */
@media (max-width: 820px) {
  .dc-boards { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .dc-main { padding: 14px 12px 40px; }
  .dc-post { padding: 12px 14px; gap: 10px; }
  .dc-post-imgs img { width: 54px; height: 54px; }
  .dc-stats { margin-left: 0; }
}
