.rank-main {
  padding: 20px 0 48px;
  background: var(--bg-light);
  min-height: 60vh;
}
.rank-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== 周榜/月榜/总榜 Tab ===== */
.rank-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
}
.rank-tab {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 10px 36px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.rank-tab:hover { color: var(--accent); }
.rank-tab.active {
  color: var(--accent);
  font-weight: 700;
  border-bottom-color: var(--accent);
}

/* ===== Panel 显示/隐藏 ===== */
.rank-panel { display: none; }
.rank-panel.active { display: block; }

/* ===== 三栏 Grid ===== */
.rank-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: flex-start;
}

/* ===== 每栏 ===== */
.rank-col {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.rank-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.rank-col-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.rank-more {
  font-size: 12px;
  color: var(--text-muted);
  transition: color 0.15s;
}
.rank-more:hover { color: var(--accent); }

/* ===== 第一名大图 ===== */
.rank-top1 {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.rank-top1 > a {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.rank-top1-thumb {
  position: relative;
  width: 60px;
  flex-shrink: 0;
  border-radius: 5px;
  overflow: hidden;
}
.rank-top1-thumb img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}
.rank-top1-n {
  position: absolute;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 0 0 4px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rank-top1-info { flex: 1; min-width: 0; }
.rank-top1-info h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-top1-info p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-status { color: #22c55e !important; }
.rank-views {
  font-size: 11px;
  color: var(--accent);
  margin-top: 4px;
  display: block;
}
.rank-top1 > a:hover .rank-top1-info h4 { color: var(--accent); }

/* ===== 2-N 列表 ===== */
.rank-list {
  list-style: none;
  padding: 4px 0;
}
.rank-list > li {
  border-bottom: 1px solid var(--border);
}
.rank-list > li:last-child { border-bottom: none; }
.rank-list > li > a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  transition: background 0.15s;
  /* 让 a 撑满整行 */
  width: 100%;
  box-sizing: border-box;
}
.rank-list > li > a:hover { background: var(--accent-light); }
.rank-list > li > a:hover .rn-name { color: var(--accent); }

/* 排名数字：1橘/2金/3橘红/其他灰 */
.rn {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #f0f0f0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rn--1 { background: var(--accent); color: #fff; }
.rn--2 { background: #fbbf24; color: #fff; }
.rn--3 { background: #f97316; color: #fff; }

.rn-name {
  flex: 1;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}
.rn-views {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: auto;
}
.rn-views::before {
  content: '🔥 ';
  font-size: 10px;
  margin-right: 2px;
}

/* ===== RWD ===== */

/* 平板：2栏 */
@media (max-width: 1024px) {
  .rank-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 手机 */
@media (max-width: 767px) {
  .rank-main { padding: 0 0 68px; background: var(--bg-light); }
  .rank-wrap { padding: 0; }

  /* Tab 置满宽度 */
  .rank-tabs {
    margin-bottom: 0;
    border-bottom: none;
    background: var(--bg-white);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .rank-tab {
    flex: 1;
    font-size: 14px;
    padding: 12px 0;
    text-align: center;
  }

  /* 单栏 */
  .rank-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 10px 0;
  }
  .rank-col { border-radius: var(--radius); }

  /* 第一名封面稍大 */
  .rank-top1-thumb { width: 70px; }
  .rank-top1-info h4 { font-size: 14px; }

  /* 列表字体 */
  .rn-name { font-size: 13px; }
}

/* 小手机 */
@media (max-width: 479px) {
  .rank-tab { font-size: 13px; padding: 10px 0; }
}