/* =============================================
   AI工具排行榜 v4 — 清爽亮色主题
   ============================================= */

.rk-page-header {
  padding: 36px 0 24px;
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  color: #fff;
  text-align: center;
}
.rk-page-title { font-size: 28px; font-weight: 800; margin: 0 0 6px; }
.rk-page-desc { font-size: 14px; opacity: 0.9; max-width: 500px; margin: 0 auto; }

/* ---- 主内容 ---- */
.rk-main { padding: 28px 0 50px; }
.rk-main .container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ---- 筛选栏 ---- */
.rk-filter-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 20px;
  padding: 12px 18px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  flex-wrap: wrap;
}

.rk-sort-tabs {
  display: flex; gap: 2px;
  background: #f1f5f9;
  border-radius: 8px; padding: 3px;
}
.rk-sort-btn {
  padding: 7px 14px; border: none;
  background: transparent; color: #64748b;
  font-size: 13px; font-weight: 500;
  border-radius: 6px; cursor: pointer;
  transition: all 0.15s;
}
.rk-sort-btn:hover { color: #475569; }
.rk-sort-btn.active { background: #6366f1; color: #fff; }

.rk-search {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px; min-width: 200px;
}
.rk-search i { color: #94a3b8; font-size: 13px; }
.rk-search input {
  border: none; outline: none;
  background: transparent; color: #334155; font-size: 13px; width: 100%;
}
.rk-search input::placeholder { color: #94a3b8; }

/* ---- 列表 ---- */
.rk-list { display: flex; flex-direction: column; gap: 8px; }
.rk-list.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .rk-list.card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .rk-list.card-grid { grid-template-columns: repeat(2, 1fr); } }
.rk-loading { text-align: center; padding: 60px 0; color: #94a3b8; font-size: 14px; }

/* 分类标题 */
.rk-cat-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; padding: 14px 18px;
  background: #fff; border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.rk-cat-header .cat-icon { font-size: 24px; }
.rk-cat-header .cat-name { font-size: 18px; font-weight: 700; color: #1e293b; }
.rk-cat-header .cat-count { font-size: 13px; color: #94a3b8; margin-left: auto; }

.rk-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: all 0.2s;
  text-decoration: none; color: inherit;
}
.rk-card:hover {
  background: #f8fafc;
  border-color: #6366f1;
  box-shadow: 0 4px 12px rgba(99,102,241,0.1);
  transform: translateX(2px);
}

/* 卡片网格模式 — 垂直卡片 */
.rk-list.card-grid .rk-card {
  flex-direction: column; align-items: center; text-align: center;
  gap: 4px; padding: 14px 10px 12px;
  transform: none;
  position: relative;
  min-width: 0;
  aspect-ratio: 4 / 3;
  justify-content: center;
}
.rk-list.card-grid .rk-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(99,102,241,0.1);
  border-color: #6366f1;
}
.rk-list.card-grid .rk-num {
  position: absolute; top: 8px; left: 10px;
  width: 22px; height: 22px; font-size: 11px; border-radius: 5px;
  background: #6366f1; color: #fff;
  line-height: 22px;
}
.rk-list.card-grid .rk-num.top1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.rk-list.card-grid .rk-num.top2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.rk-list.card-grid .rk-num.top3 { background: linear-gradient(135deg, #d97706, #92400e); color: #fff; }

.rk-list.card-grid .rk-logo {
  width: 44px; height: 44px; border-radius: 12px;
  font-size: 22px; margin-bottom: 2px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  flex-shrink: 0;
}
.rk-list.card-grid .rk-logo img {
  width: 100%; height: 100%; object-fit: contain;
  padding: 4px;
}
.rk-list.card-grid .rk-info { text-align: center; }
.rk-list.card-grid .rk-name { font-size: 14px; font-weight: 600; margin-bottom: 1px; }
.rk-list.card-grid .rk-tagline { font-size: 11px; color: #94a3b8; margin-bottom: 6px; line-height: 1.3; max-height: 2.6em; overflow: hidden; }
.rk-list.card-grid .rk-tags { justify-content: center; }
.rk-list.card-grid .rk-tag { font-size: 10px; padding: 1px 6px; }
.rk-list.card-grid .rk-scores {
  flex-direction: row; gap: 10px; margin-top: 4px;
  padding-top: 8px; border-top: 1px solid #f1f5f9;
  width: 100%; justify-content: center;
}
.rk-list.card-grid .rk-score-row { gap: 3px; }
.rk-list.card-grid .rk-score-label { font-size: 10px; }
.rk-list.card-grid .rk-score-value { font-size: 13px; font-weight: 700; min-width: auto; }
.rk-list.card-grid .rk-change { display: none; }
.rk-list.card-grid .rk-visit { opacity: 0; margin-top: 2px; }
.rk-list.card-grid .rk-card:hover .rk-visit { opacity: 1; }
.rk-list.card-grid .rk-visit-btn {
  padding: 4px 14px; background: #6366f1; color: #fff;
  border-radius: 5px; font-size: 11px;
}

.rk-num {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
  background: #f1f5f9; color: #64748b;
}
.rk-num.top1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.rk-num.top2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.rk-num.top3 { background: linear-gradient(135deg, #d97706, #92400e); color: #fff; }

.rk-logo {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0; overflow: hidden;
}
.rk-logo img { width: 100%; height: 100%; object-fit: cover; }

.rk-info { flex: 1; min-width: 0; }
.rk-name { font-size: 15px; font-weight: 600; color: #1e293b; }
.rk-tagline { font-size: 12px; color: #94a3b8; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.rk-tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.rk-tag {
  padding: 2px 8px;
  background: #eef2ff; color: #6366f1;
  border-radius: 4px; font-size: 11px;
}

.rk-scores {
  display: flex; flex-direction: column; gap: 2px;
  flex-shrink: 0; min-width: 70px; text-align: right;
}
.rk-score-row { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.rk-score-label { font-size: 11px; color: #94a3b8; }
.rk-score-value { font-size: 13px; font-weight: 600; color: #6366f1; min-width: 42px; text-align: right; }

.rk-change { width: 36px; text-align: center; flex-shrink: 0; font-size: 13px; font-weight: 600; }
.rk-change.up { color: #10b981; }
.rk-change.down { color: #ef4444; }
.rk-change.same { color: #94a3b8; }

.rk-visit { flex-shrink: 0; opacity: 0; transition: opacity 0.2s; }
.rk-card:hover .rk-visit { opacity: 1; }
.rk-visit-btn {
  padding: 6px 14px;
  background: #6366f1; color: #fff;
  border-radius: 6px; font-size: 12px; white-space: nowrap;
}

/* ---- 分页 ---- */
.rk-pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 28px; }
.rk-page-btn {
  padding: 7px 13px;
  border: 1px solid #e2e8f0; background: #fff;
  color: #64748b; border-radius: 8px;
  font-size: 13px; cursor: pointer; transition: all 0.15s;
}
.rk-page-btn:hover { background: #f1f5f9; color: #334155; }
.rk-page-btn.active { background: #6366f1; color: #fff; border-color: #6366f1; }
.rk-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .rk-page-header { padding: 24px 0 16px; }
  .rk-page-title { font-size: 22px; }
  .rk-filter-bar { flex-direction: column; }
  .rk-sort-tabs { width: 100%; justify-content: center; }
  .rk-search { width: 100%; }
  .rk-card { padding: 12px 14px; gap: 10px; }
  .rk-num { width: 28px; height: 28px; font-size: 12px; }
  .rk-logo { width: 36px; height: 36px; font-size: 18px; }
  .rk-visit { display: none; }
}
@media (min-width: 1200px) { .rk-main .container { max-width: 1000px; } }
