/**
 * css/search/hot.css
 * 热搜榜单页（/search/hot）+ 侧边栏热搜组件（hot-widget）样式。
 * 使用 main.css CSS 变量保持风格统一。
 */

/* ── 热搜页标题区 ──────────────────────────────────────────────── */
.hot-page__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: var(--sp-md, 12px);
}

.hot-page__title {
  font-size: var(--fs-xl, 1.25rem);
  font-weight: 700;
  color: var(--c-text, #2c2520);
  margin: 0;
}

/* ── Tab 切换 ────────────────────────────────────────────────── */
.hot-page__tabs {
  display: flex;
  gap: 4px;
  background: var(--c-surface-alt, #faf7f3);
  border: 1px solid var(--c-border-light, #eae4dd);
  border-radius: 8px;
  padding: 3px;
}

.hot-tab {
  padding: 6px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--c-text-secondary, #8c7e72);
  font-size: var(--fs-sm, 0.875rem);
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, color .12s;
  white-space: nowrap;
}

.hot-tab:hover {
  background: var(--c-surface, #fff);
  color: var(--c-text, #2c2520);
}

.hot-tab.is-active {
  background: var(--c-surface, #fff);
  color: var(--c-primary, #8b411c);
  font-weight: 700;
  box-shadow: 0 1px 3px var(--c-shadow, rgba(0,0,0,.08));
}

/* ── 列表容器 ────────────────────────────────────────────────── */
.hot-list {
  background: var(--c-surface, #fff);
  border-radius: var(--radius-lg, 8px);
  border: 1px solid var(--c-border-light, #eae4dd);
  box-shadow: 0 1px 3px var(--c-shadow, rgba(0,0,0,.06));
  overflow: hidden;
}

.hot-list__loading,
.hot-list__empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--c-text-secondary, #8c7e72);
  font-size: var(--fs-sm, 0.875rem);
}

.hot-list__loading {
  animation: sr-pulse 1.2s ease-in-out infinite;
}

/* ── 热词排行列表 ─────────────────────────────────────────────── */
.hot-list__ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hot-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border-light, #f0ece6);
  transition: background .08s;
}

.hot-item:last-child { border-bottom: none; }

.hot-item:hover {
  background: var(--c-surface-alt, #faf7f3);
}

/* 排名徽章 */
.hot-item__rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--c-surface-alt, #f3f0eb);
  color: var(--c-text-secondary, #8c7e72);
  font-size: var(--fs-sm, 0.875rem);
  font-weight: 700;
  flex-shrink: 0;
}

.hot-item__rank.rank--gold   { background: #fef3c7; color: #b45309; }
.hot-item__rank.rank--silver { background: #f1f5f9; color: #475569; }
.hot-item__rank.rank--bronze { background: #fff7ed; color: #c2410c; }

/* 关键词链接 */
.hot-item__keyword {
  flex: 1;
  font-size: var(--fs-base, 1rem);
  font-weight: 600;
  color: var(--c-text, #2c2520);
  text-decoration: none;
  font-family: var(--ff-serif, serif);
  transition: color .08s;
}

.hot-item__keyword:hover {
  color: var(--c-primary, #8b411c);
  text-decoration: underline;
}

/* 次数 */
.hot-item__count {
  font-size: var(--fs-xs, 0.75rem);
  color: var(--c-text-secondary, #8c7e72);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── 侧边栏附加样式 ───────────────────────────────────────────── */
.sidebar-tips-text {
  font-size: var(--fs-sm, 0.875rem);
  color: var(--c-text-secondary, #8c7e72);
  margin: 0 0 8px;
  line-height: 1.6;
}

.sidebar-search-link {
  display: inline-block;
  font-size: var(--fs-sm, 0.875rem);
  color: var(--c-primary, #8b411c);
  text-decoration: none;
  font-weight: 600;
}
.sidebar-search-link:hover { text-decoration: underline; }

.sidebar-index-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.sidebar-index-links a {
  display: block;
  padding: 6px 8px;
  border-radius: var(--radius-sm, 4px);
  background: var(--c-surface-alt, #faf7f3);
  color: var(--c-text, #2c2520);
  text-decoration: none;
  font-size: var(--fs-sm, 0.875rem);
  text-align: center;
  transition: background .08s;
}
.sidebar-index-links a:hover {
  background: var(--c-border-light, #eae4dd);
  color: var(--c-primary, #8b411c);
}

/* ── 深色模式 ────────────────────────────────────────────────── */
[data-theme="dark"] .hot-list {
  background: var(--c-surface, #1e1e2e);
  border-color: #3a3a4a;
}
[data-theme="dark"] .hot-item:hover { background: #2a2a3a; }
[data-theme="dark"] .hot-item__rank { background: #2a2a3a; }
[data-theme="dark"] .hot-tab.is-active { background: #1e1e2e; }
[data-theme="dark"] .hot-page__tabs { background: #2a2a3a; border-color: #3a3a4a; }
