/* ==========================================================================
   Avalon 角色排行榜 · 复刻 DARO FluxCP 排行榜视觉（绯红瓦尔基里主题）
   依赖：static/css/site.css（:root 变量 + .topbar + footer + body 背景）
   本文件只放排行榜特有样式。色值一律用 site.css 的 CSS 变量。
   ========================================================================== */

.rank-page { width: min(1280px, 100% - 48px); margin: 0 auto; padding: 0 0 64px; }

/* ---- 标题 ---- */
.rank-title {
  text-align: left;
  font-family: var(--title);
  font-weight: 400;
  font-size: clamp(30px, 3.7vw, 46px);
  line-height: 1.1;
  color: var(--text);
  padding: 36px 0 10px;
  margin: 0;
}
.rank-sub { text-align: left; margin: 0 0 26px; font-size: 14px; color: var(--muted); }

/* ---- 工具栏：筛选 + 排序 + 搜索 ---- */
.rank-toolbar { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px; margin-bottom: 32px; }
.rank-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; margin: 0; min-height: 44px; }
.rank-filters label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.rank-filters select {
  font: inherit; font-size: 13px; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 8px;
  background-color: #140d12; padding: 8px 10px; cursor: pointer;
}
.rank-filters select:focus { outline: none; border-color: var(--gold); }
.rank-searchbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0; flex-direction: column; align-items: flex-end; max-width: 380px; }
.rank-search { display: flex; align-items: center; gap: 10px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 14px; width: 280px; color: var(--gold); }
.rank-search:focus-within { border-color: var(--gold); }
.rank-search input[type=search] { min-width: 0; width: 100%; border: 0; padding: 10px 0; border-radius: 0; background: transparent; box-shadow: none; outline: none; color: var(--text); font: inherit; font-size: 13px; }
.rank-search input::placeholder { color: var(--muted); }
.rank-search-status { color: var(--muted); font-size: 12px; margin: 0; }

/* ---- 领奖台（Top 3）---- */
.rank-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; max-width: 1080px; margin: 0 auto 30px; align-items: end; }
.rank-podium.single { grid-template-columns: minmax(0, 360px); justify-content: center; }
.rank-top {
  --rank-rgb: 219, 181, 106;
  position: relative; text-align: center; overflow: hidden;
  background: radial-gradient(ellipse at 50% 28%, rgba(var(--rank-rgb), .05), transparent 65%),
              linear-gradient(145deg, #21141e, #140d14);
  border: 1px solid rgba(var(--rank-rgb), .26);
  border-radius: 13px;
  transition: border-color .25s, transform .25s;
}
.rank-top:hover { border-color: rgba(var(--rank-rgb), .6); transform: translateY(-4px); }
.rank-top.rank-2 { --rank-rgb: 101, 197, 182; }
.rank-top.rank-3 { --rank-rgb: 164, 132, 218; }

.rank-top-look { position: relative; height: 254px; display: flex; justify-content: center; align-items: flex-end; padding-bottom: 4px; isolation: isolate; border-bottom: 1px solid var(--line); }
.rank-1 .rank-top-look { height: 278px; }
.rank-medal { position: absolute; z-index: 4; top: 24px; left: 50%; transform: translateX(-50%); width: auto; min-width: 62px; height: 29px; border-radius: 20px; border: 1px solid rgba(var(--rank-rgb), .5); background: rgba(var(--rank-rgb), .07); color: rgb(var(--rank-rgb)); font-size: 14px; font-weight: 800; display: grid; place-items: center; padding: 0 14px; }
.rank-halo { position: absolute; z-index: -1; left: 50%; bottom: 8px; width: 182px; height: 182px; transform: translateX(-50%); border-radius: 50%; border: 12px solid rgba(var(--rank-rgb), .08); background: radial-gradient(ellipse at 50% 58%, rgba(var(--rank-rgb), .13), transparent 70%); }
.rank-halo::after { content: ''; position: absolute; left: -12px; right: -12px; height: 24px; bottom: -14px; border-radius: 50%; background: radial-gradient(ellipse, rgba(var(--rank-rgb), .3), transparent 68%); }
.rank-render { position: relative; z-index: 1; width: 196px; height: 196px; object-fit: contain; image-rendering: auto; margin-bottom: 0; }
.rank-render.none { width: 56px; height: 56px; align-self: center; margin: 70px 0 0; }

.rank-top-info { padding: 20px 14px 24px; display: grid; gap: 6px; }
.rank-name { display: flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--title); font-weight: 400; font-size: clamp(22px, 2vw, 29px); line-height: 1.3; overflow-wrap: anywhere; color: #fff; }
.rank-ico { width: 22px; height: 22px; flex: none; }
.rank-class { color: rgb(var(--rank-rgb)); font-size: 12px; font-weight: 600; }
.rank-guild { color: var(--muted); font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 24px; min-width: 0; }
.rank-guild img { width: 24px; height: 24px; flex: none; image-rendering: pixelated; border-radius: 4px; }
.rank-stats { display: flex; justify-content: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.rank-stats > span { background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 8px; padding: 4px 7px; font-weight: 700; font-size: 13px; color: var(--text); white-space: nowrap; }
.rank-stats small { color: #a48b97; font-weight: 600; font-size: 9px; text-transform: uppercase; margin-right: 5px; }
.rank-stats .score { border-color: rgba(232, 193, 109, .6); background: rgba(232, 193, 109, .1); color: var(--gold-2); }
.rank-stats .score small { color: var(--gold); }
.rank-exp { display: flex; justify-content: center; gap: 10px; color: #a48b97; font-size: 12px; flex-wrap: wrap; }
.rank-exp b { color: #d0b7c3; }

/* ---- 列表（4~100）---- */
.rank-list { list-style: none; margin: 0 auto 40px; padding: 0; max-width: 1400px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(232px, 100%), 1fr)); gap: 12px; }
.rank-row { position: relative; display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: center; column-gap: 11px; row-gap: 7px; background: #180e15; border: 1px solid var(--line); border-radius: 12px; padding: 25px 12px 13px; transition: border-color .2s, transform .2s; }
.rank-row:hover { transform: translateY(-2px); border-color: rgba(255, 125, 149, .4); }
.rank-row > .rank-frame { grid-row: 1 / 3; }
.rank-row > .rank-who { grid-column: 2; align-self: end; }
.rank-row > .rank-pos { position: absolute; top: 3px; left: 11px; font-size: 13px; text-align: left; }
.rank-pos { text-align: center; font-weight: 800; font-size: 16px; color: var(--muted); }
.rank-frame { position: relative; width: 68px; height: 68px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #3a1d2c, #140a0f 72%); }
.rank-portrait { display: block; width: 68px; height: 68px; border-radius: 50%; object-fit: cover; position: relative; z-index: 1; border: 2px solid #c99a3e; box-shadow: 0 0 0 1px #2a1a00, 0 3px 10px rgba(0, 0, 0, .45); box-sizing: border-box; background: #140a0f; }
.rank-portrait.none { width: 68px; height: 68px; padding: 18px; }
.rank-badge { position: absolute; left: -4px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; background: #8a2a4c; border: 2px solid #c99a3e; padding: 2px; box-sizing: border-box; z-index: 2; }
.rank-lv { position: absolute; right: -6px; bottom: -2px; min-width: 26px; height: 24px; padding: 0 4px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; font-size: 11px; color: #f6dc9c; background: #3a0d0d; border: 2px solid #c99a3e; box-sizing: border-box; z-index: 2; }
.rank-who { display: grid; gap: 1px; min-width: 0; }
.rank-who .rank-name { justify-content: flex-start; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--body); font-weight: 700; }
.rank-who .rank-class { color: var(--aqua); font-size: 12px; }
.rank-who .rank-guild { justify-content: flex-start; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .rank-stats { grid-column: 2; margin: 0; justify-content: flex-start; align-self: start; gap: 3px; }
.rank-row .rank-stats > span { font-size: 12px; padding: 1px 4px; border-radius: 7px; }
.rank-row .rank-stats small { font-size: 9px; margin-right: 3px; letter-spacing: 0; }
.rank-row > .rank-exp { grid-column: 1 / -1; justify-content: flex-end; margin-top: 1px; font-size: 11px; gap: 8px; }

/* ---- 空榜提示 ---- */
.rank-empty { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 15px; border: 1px dashed var(--line-strong); border-radius: 16px; }

/* ---- 响应式 ---- */
@media (max-width: 720px) {
  .rank-podium { grid-template-columns: 1fr; max-width: 320px; }
  .rank-podium .rank-1 { order: -1; }
  .rank-render { width: 170px; height: 170px; }
  .rank-toolbar { flex-direction: column; }
  .rank-searchbar { align-items: flex-start; max-width: none; }
  .rank-search { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .rank-top, .rank-row { transition: none; }
}
