/*!
 * 牛马榜单 · 全站样式
 * ------------------------------------------------------------------
 * 一套代码同时适配 H5 与 PC：
 *   - 移动优先，≥860px 时切换为 PC 布局（顶部导航 + 多列网格）
 *   - 榜单主题色通过内联 style="--c1:..;--c2:.." 注入，5 个榜单共用同一套组件
 * 目录：
 *   01 设计变量   02 重置   03 布局/容器   04 顶部导航/底部Tab
 *   05 按钮      06 卡片   07 首页Hero    08 榜单卡片/统计条
 *   09 排行榜    10 领奖台 11 指数环/维度条 12 等级徽章
 *   13 表单      14 分段控件/筛选  15 弹层/Toast  16 海报  17 骨架屏/空态  18 工具类
 */

/* ============================================================
   01 设计变量
   ============================================================ */
:root {
  /* 中性色 */
  --bg: #f2f3f7;
  --bg-2: #e8eaf0;
  --card: #ffffff;
  --ink: #0f1117;
  --ink-2: #464e63;
  --ink-3: #838ca3;
  --ink-4: #aab2c4;
  --line: #e5e8ef;
  --line-2: #eef0f5;

  /* 品牌色（牛马红） */
  --brand: #e03131;
  --brand-2: #c2255c;
  --brand-soft: #fff0f0;

  /* 榜单主题色，组件内可被覆盖 */
  --c1: #e03131;
  --c2: #c2255c;

  /* 语义色 */
  --ok: #0ca678;
  --warn: #f59f00;
  --danger: #e03131;

  /* 形状 */
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --r-full: 999px;

  /* 阴影 */
  --sh-1: 0 1px 2px rgba(15, 17, 23, .05), 0 1px 3px rgba(15, 17, 23, .05);
  --sh-2: 0 4px 12px -4px rgba(15, 17, 23, .10), 0 2px 6px -2px rgba(15, 17, 23, .06);
  --sh-3: 0 16px 32px -12px rgba(15, 17, 23, .18), 0 4px 12px -4px rgba(15, 17, 23, .08);
  --sh-4: 0 32px 64px -24px rgba(15, 17, 23, .28);

  /* 尺寸 */
  --maxw: 1120px;
  --gut: 16px;
  --hdr: 56px;
  --tabbar: 58px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ============================================================
   02 重置
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
               'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; border: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

/* 数字统一等宽，榜单对齐才好看 */
.num, .index-big, .rank-no, .stat-v, .dim-score, .bar-val {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* ============================================================
   03 布局 / 容器
   ============================================================ */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); }
.wrap-narrow { max-width: 720px; }
.page { padding-bottom: 40px; }
/* 为 H5 底部 Tab 让位 */
body.has-tabbar .page { padding-bottom: calc(var(--tabbar) + 24px + env(safe-area-inset-bottom)); }

.sec { margin-top: 28px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-title { font-size: 19px; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.sec-title::before { content: ''; width: 4px; height: 17px; border-radius: 2px; background: linear-gradient(180deg, var(--brand), var(--brand-2)); }
.sec-sub { font-size: 12.5px; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.tiny { font-size: 12px; }
.center { text-align: center; }

/* PC 两栏 */
.split { display: grid; gap: 20px; }
@media (min-width: 860px) {
  :root { --gut: 24px; --hdr: 64px; }
  .split { grid-template-columns: minmax(0, 1fr) 316px; align-items: start; }
  .split > .side { position: sticky; top: calc(var(--hdr) + 20px); }
}

/* ============================================================
   04 顶部导航 / 底部 Tab
   ============================================================ */
.hdr {
  position: sticky; top: 0; z-index: 60;
  height: var(--hdr);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.hdr-in { height: 100%; display: flex; align-items: center; gap: 14px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 17px; letter-spacing: -.02em; white-space: nowrap; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center;
  font-size: 17px; font-weight: 900; color: #fff; line-height: 1;
  box-shadow: 0 3px 10px -2px rgba(224, 49, 49, .5);
}
.logo-sub { font-size: 10px; font-weight: 700; color: var(--ink-4); letter-spacing: .12em; }
.nav { display: none; margin-left: 12px; gap: 2px; }
.nav a {
  padding: 7px 14px; border-radius: var(--r-full); font-size: 14px; font-weight: 600;
  color: var(--ink-2); transition: background .18s var(--ease), color .18s var(--ease);
}
.nav a:hover { background: var(--bg-2); color: var(--ink); }
.nav a.on { background: var(--ink); color: #fff; }
.hdr-cta { margin-left: auto; }

/* 底部 Tab：仅 H5 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10.5px; font-weight: 600; color: var(--ink-3); transition: color .18s;
}
.tabbar a i { display: grid; place-items: center; height: 21px; font-style: normal; opacity: .62; transition: .18s; }
.tabbar a.on { color: var(--brand); }
.tabbar a.on i { opacity: 1; transform: translateY(-1px); }

@media (min-width: 860px) {
  .nav { display: flex; }
  .tabbar { display: none; }
  body.has-tabbar .page { padding-bottom: 40px; }
}

/* 页脚 */
.foot { padding: 32px 0 40px; margin-top: 40px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px; }
.foot-in { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.foot a:hover { color: var(--brand); }

/* ============================================================
   05 按钮
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 44px; padding: 0 20px; border-radius: var(--r-full);
  font-size: 15px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s var(--ease), box-shadow .18s var(--ease), background .18s, opacity .18s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .5; pointer-events: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  box-shadow: 0 6px 18px -6px rgba(224, 49, 49, .6);
}
.btn-primary:hover { box-shadow: 0 10px 24px -8px rgba(224, 49, 49, .7); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #23262f; }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: var(--sh-1); }
.btn-ghost:hover { border-color: var(--ink-4); }
.btn-plain { background: transparent; color: var(--ink-2); }
.btn-plain:hover { background: var(--bg-2); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-lg { height: 52px; padding: 0 30px; font-size: 16.5px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   06 卡片
   ============================================================ */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-1); overflow: hidden;
}
.card-pad { padding: 18px; }
.card-hd {
  padding: 14px 18px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-weight: 800; font-size: 15px;
}
.card-bd { padding: 16px 18px; }
.card-ft { padding: 12px 18px; border-top: 1px solid var(--line-2); background: #fafbfc; }

/* ============================================================
   07 首页 Hero
   ============================================================ */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: #12131a;
  padding: 44px 0 76px;
  margin-bottom: -46px;
}
.hero::before, .hero::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
}
.hero::before {
  width: 460px; height: 460px; top: -190px; right: -130px;
  background: radial-gradient(circle, rgba(224, 49, 49, .58), transparent 68%);
}
.hero::after {
  width: 400px; height: 400px; bottom: -220px; left: -120px;
  background: radial-gradient(circle, rgba(112, 72, 232, .48), transparent 68%);
}
.hero-grid {
  position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 78%);
}
.hero-in { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 13px; border-radius: var(--r-full); font-size: 12.5px; font-weight: 700;
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14);
  color: #ffd9d9; margin-bottom: 16px;
}
.hero-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .2); }
.hero h1 {
  font-size: clamp(28px, 7vw, 46px); line-height: 1.14; font-weight: 900;
  letter-spacing: -.03em; margin-bottom: 12px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #ff8a8a, #ffd43b 55%, #a78bfa);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { color: rgba(255, 255, 255, .72); font-size: 15px; max-width: 540px; }
.hero .btn-row { margin-top: 24px; }
.hero .btn-ghost { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .17); }
@media (min-width: 860px) {
  .hero { padding: 70px 0 104px; margin-bottom: -60px; }
  .hero p { font-size: 16.5px; }
}

/* 统计条 */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-3); overflow: hidden; position: relative; z-index: 2;
}
.stats > div { padding: 16px 10px; text-align: center; position: relative; }
.stats > div + div::before { content: ''; position: absolute; left: 0; top: 22%; height: 56%; width: 1px; background: var(--line); }
.stat-v { font-size: 24px; font-weight: 900; letter-spacing: -.02em; line-height: 1.2; }
.stat-v small { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-left: 2px; }
.stat-k { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
@media (min-width: 860px) { .stat-v { font-size: 30px; } }

/* ============================================================
   08 榜单卡片 / 网格
   ============================================================ */
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-2 { gap: 16px; } }

.board-card {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--r-lg); padding: 18px; color: #fff; isolation: isolate;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: var(--sh-2);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.board-card:hover { transform: translateY(-3px); box-shadow: var(--sh-3); }
.board-card::after {
  content: ''; position: absolute; width: 190px; height: 190px; right: -76px; top: -70px;
  border-radius: 50%; background: rgba(255, 255, 255, .15); z-index: -1;
}
.board-card .bc-top { display: flex; align-items: flex-start; gap: 10px; }
.board-card .bc-icon { flex: none; line-height: 0; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .22)); }
.board-card .bc-name { display: block; font-size: 17.5px; font-weight: 900; letter-spacing: -.01em; line-height: 1.3; }
.board-card .bc-tag { display: block; font-size: 12.5px; color: rgba(255, 255, 255, .84); margin-top: 2px; line-height: 1.4; }
.board-card .bc-arrow {
  margin-left: auto; width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-size: 14px;
}
.board-card .bc-foot {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px;
}
.board-card .bc-foot b { font-size: 19px; font-weight: 900; }
.board-card .bc-foot span { color: rgba(255, 255, 255, .8); }
.board-card.wide::after { width: 240px; height: 240px; right: -90px; top: -100px; }
@media (min-width: 860px) {
  .board-card { padding: 20px; }
  .board-card .bc-icon { font-size: 34px; }
  .board-card .bc-name { font-size: 19px; }
}

/* 小尺寸榜单入口（用于侧栏） */
.board-mini {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--card); transition: .18s var(--ease);
}
.board-mini:hover { border-color: var(--c1); transform: translateX(2px); }
.board-mini .bm-ic {
  width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2));
}
.board-mini .bm-t { display: block; font-weight: 700; font-size: 14px; line-height: 1.35; }
.board-mini .bm-s { display: block; font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }
.board-mini .bm-r { margin-left: auto; text-align: right; font-size: 11.5px; color: var(--ink-3); flex: none; }
.board-mini .bm-r b { display: block; font-size: 16px; color: var(--ink); }

/* ============================================================
   09 排行榜
   ============================================================ */
.tabs { display: flex; gap: 7px; overflow-x: auto; padding: 3px 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 15px; border-radius: var(--r-full);
  border: 1px solid var(--line); background: var(--card);
  font-size: 13.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap;
  transition: .2s var(--ease);
}
.tab:hover { border-color: var(--ink-4); }
.tab.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.tab .tab-ic { display: inline-flex; align-items: center; }

.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 14px 0 12px;
}
.select {
  height: 36px; padding: 0 30px 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23838ca3'/%3E%3C/svg%3E") no-repeat right 11px center;
  font-size: 13.5px; font-weight: 600; appearance: none; -webkit-appearance: none; cursor: pointer;
}
.select:focus { outline: 2px solid rgba(224, 49, 49, .28); outline-offset: 1px; }

/* 排行榜条目 */
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--sh-1);
  transition: .18s var(--ease);
}
.rank-item:hover { border-color: var(--ink-4); transform: translateY(-1px); box-shadow: var(--sh-2); }
.rank-item.is-mine { border-color: var(--brand); background: linear-gradient(180deg, var(--brand-soft), var(--card) 60%); }
.rank-item.is-mine::before {
  content: '我'; position: absolute; left: -1px; top: -1px;
  background: var(--brand); color: #fff; font-size: 10px; font-weight: 800;
  padding: 1px 7px 2px; border-radius: var(--r) 0 10px 0;
}
.rank-no {
  width: 32px; flex: none; text-align: center;
  font-size: 16px; font-weight: 900; color: var(--ink-3); letter-spacing: -.03em;
}
.rank-item.top1 .rank-no, .rank-item.top2 .rank-no, .rank-item.top3 .rank-no { font-size: 22px; }
.rank-item.top1 { border-color: #f0c419; background: linear-gradient(100deg, #fffbf0, var(--card) 55%); }
.rank-item.top2 { border-color: #c9d1dd; background: linear-gradient(100deg, #fafbfc, var(--card) 55%); }
.rank-item.top3 { border-color: #e3b98a; background: linear-gradient(100deg, #fffaf5, var(--card) 55%); }

.rank-main { min-width: 0; flex: 1; }
.rank-name { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14.5px; }
.rank-name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; font-size: 11.5px; color: var(--ink-3); }
.chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1.5px 7px; border-radius: var(--r-full);
  background: var(--bg-2); color: var(--ink-2); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.chip-soft { background: var(--brand-soft); color: var(--brand); }
.chip-line { background: transparent; border: 1px solid var(--line); }

.rank-score { text-align: right; flex: none; }
.rank-score .sc { font-size: 22px; font-weight: 900; letter-spacing: -.03em; line-height: 1.1; color: var(--c1); }
.rank-score .sc small { font-size: 11px; font-weight: 700; color: var(--ink-3); }
.rank-score .gd { font-size: 11px; color: var(--ink-3); margin-top: 1px; white-space: nowrap; }

/* ============================================================
   10 领奖台（前三名）
   ============================================================ */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: end; margin-bottom: 16px; }
.podium-item {
  position: relative; text-align: center; padding: 14px 8px 12px; border-radius: var(--r);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--sh-2); overflow: hidden;
}
.podium-item::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--c1), var(--c2)); }
.podium-item.p1 { order: 2; padding-top: 20px; padding-bottom: 18px; border-color: #f0c419; box-shadow: 0 10px 26px -12px rgba(240, 196, 25, .7); }
.podium-item.p2 { order: 1; }
.podium-item.p3 { order: 3; }
.podium-item .pd-medal { line-height: 0; }
.podium-item.p1 .pd-medal .rank-medal { --rm: 34px; }
.podium-item .pd-name { font-size: 12.5px; font-weight: 700; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-item .pd-sc { font-size: 21px; font-weight: 900; letter-spacing: -.03em; color: var(--c1); line-height: 1.2; }
.podium-item.p1 .pd-sc { font-size: 26px; }
.podium-item .pd-city { font-size: 10.5px; color: var(--ink-3); }

/* 加载更多 / 分页 */
.loadmore { display: grid; place-items: center; padding: 18px 0 4px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 16px 0 4px; flex-wrap: wrap; }
.pager button {
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--card); font-size: 13.5px; font-weight: 600; color: var(--ink-2);
}
.pager button:hover:not(:disabled) { border-color: var(--ink-4); }
.pager button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager .pg-ellipsis { color: var(--ink-4); padding: 0 2px; }

/* ============================================================
   11 指数环 / 维度条
   ============================================================ */
.score-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ring {
  --p: 0; --ring-c: var(--c1);
  position: relative; width: 124px; height: 124px; flex: none; border-radius: 50%;
  background: conic-gradient(var(--ring-c) calc(var(--p) * 1%), var(--line) 0);
  display: grid; place-items: center;
  transition: --p .8s var(--ease);
}
.ring::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--card); }
.ring-in { position: relative; z-index: 1; text-align: center; }
.ring-in .rv { font-size: 34px; font-weight: 900; letter-spacing: -.04em; line-height: 1; }
.ring-in .rk { font-size: 10.5px; color: var(--ink-3); font-weight: 700; letter-spacing: .06em; }
.ring-sm { width: 84px; height: 84px; }
.ring-sm .ring-in .rv { font-size: 23px; }
.ring-sm::after { inset: 7px; }
.ring-lg { width: 150px; height: 150px; }
.ring-lg .ring-in .rv { font-size: 42px; }
.ring-lg::after { inset: 11px; }

.score-side { min-width: 0; flex: 1; }
.score-side .ss-grade { display: flex; align-items: center; gap: 9px; }
.score-side .ss-gname { font-size: 21px; font-weight: 900; letter-spacing: -.02em; }
.score-side .ss-desc { color: var(--ink-2); font-size: 13.5px; margin-top: 6px; }
.score-side .ss-rank { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* 维度条 */
.dims { display: flex; flex-direction: column; gap: 13px; }
.dim { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; }
.dim-label { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.dim-label .w {
  font-size: 10px; font-weight: 700; color: var(--ink-4);
  border: 1px solid var(--line); border-radius: var(--r-full); padding: 0 5px;
}
.dim-val { font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.dim-val b { font-size: 15px; }
.bar { grid-column: 1 / -1; height: 8px; border-radius: var(--r-full); background: var(--bg-2); overflow: hidden; position: relative; }
.bar-fill {
  height: 100%; border-radius: var(--r-full); width: 0;
  background: linear-gradient(90deg, var(--c1), var(--c2));
  transition: width .7s var(--ease);
}
.bar-fill.low { background: linear-gradient(90deg, #40c057, #94d82d); }
.bar-fill.mid { background: linear-gradient(90deg, #fab005, #ff922b); }
.bar-fill.high { background: linear-gradient(90deg, #f76707, #e03131); }
.dim-score { font-size: 12px; font-weight: 800; color: var(--ink-3); }

/* ============================================================
   12 等级徽章
   ============================================================ */
.grade {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: var(--r-full);
  font-size: 12.5px; font-weight: 800; color: #fff;
  background: var(--gc, var(--brand)); box-shadow: 0 3px 10px -4px var(--gc, var(--brand));
  white-space: nowrap;
}
.grade-lg { font-size: 15px; padding: 6px 16px; }
.grade-soft { color: var(--gc, var(--brand)); background: color-mix(in srgb, var(--gc, var(--brand)) 13%, #fff); box-shadow: none; }
@supports not (background: color-mix(in srgb, red 10%, #fff)) {
  .grade-soft { background: var(--bg-2); }
}

/* ============================================================
   13 表单
   ============================================================ */
.form-sec { margin-bottom: 26px; }
.form-sec-hd {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line-2);
}
.form-sec-hd .fs-ic {
  width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2));
}
.form-sec-hd .fs-t { font-size: 16px; font-weight: 800; }
.form-sec-hd .fs-s { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.form-sec-hd .fs-n { margin-left: auto; font-size: 12px; color: var(--ink-3); }

.field { margin-bottom: 20px; }
.field-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.field-label { font-size: 14px; font-weight: 700; }
.field-label .req { color: var(--brand); margin-left: 2px; }
.field-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.field-val { font-size: 15px; font-weight: 900; color: var(--c1); white-space: nowrap; }
.field-val small { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.field-err { font-size: 12px; color: var(--danger); margin-top: 5px; display: none; }
.field.invalid .field-err { display: block; }
.field.invalid .input, .field.invalid .chips { border-color: var(--danger); }

.input, .textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--card); font-size: 15px;
  transition: border-color .18s, box-shadow .18s;
}
.textarea { height: auto; padding: 11px 14px; resize: vertical; min-height: 84px; line-height: 1.6; }
.input:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(224, 49, 49, .13); }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .unit {
  position: absolute; right: 14px; font-size: 12.5px; color: var(--ink-3); font-weight: 600; pointer-events: none;
}
.input-group .input { padding-right: 56px; }

/* 滑杆 */
.slider-wrap { display: flex; align-items: center; gap: 12px; }
input[type='range'].slider {
  -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: var(--r-full);
  background: var(--bg-2); outline: none; cursor: pointer;
}
input[type='range'].slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: 6px solid var(--c1); box-shadow: var(--sh-2); cursor: grab;
  transition: transform .15s var(--ease);
}
input[type='range'].slider::-webkit-slider-thumb:active { transform: scale(1.14); cursor: grabbing; }
input[type='range'].slider::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 6px solid var(--c1);
  box-shadow: var(--sh-2); cursor: grab;
}
.slider-scale { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-4); margin-top: 3px; }

/* 选项 chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips input { position: absolute; opacity: 0; width: 0; height: 0; }
.chips label {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 14px; border-radius: var(--r-full); border: 1px solid var(--line);
  background: var(--card); font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; transition: .18s var(--ease); user-select: none;
}
.chips label:hover { border-color: var(--ink-4); }
.chips input:checked + label {
  background: var(--ink); border-color: var(--ink); color: #fff;
}
.chips.chips-brand input:checked + label { background: var(--c1); border-color: var(--c1); }
.chips input:focus-visible + label { outline: 2px solid rgba(224, 49, 49, .4); outline-offset: 2px; }

/* 分步进度 */
.steps { display: flex; align-items: center; gap: 4px; margin-bottom: 20px; }
.step { flex: 1; text-align: center; position: relative; font-size: 11.5px; font-weight: 700; color: var(--ink-4); }
.step::before {
  content: ''; display: block; height: 3px; border-radius: 2px; background: var(--bg-2); margin-bottom: 6px;
  transition: background .3s;
}
.step.done::before { background: var(--ok); }
.step.on { color: var(--ink); }
.step.on::before { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

/* 实时预览 / 吸底操作条（测算页与详情页共用） */
.live-preview {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  padding: 10px var(--gut) calc(10px + env(safe-area-inset-bottom));
}
.live-in { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.live-in .lp-t { font-size: 11.5px; color: var(--ink-3); line-height: 1.4; min-width: 0; }
.live-in .lp-t b { display: block; font-size: 13.5px; color: var(--ink); }
.live-in .lp-t span {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
}
.live-in .lp-score {
  font-size: 28px; font-weight: 900; letter-spacing: -.04em; line-height: 1; color: var(--c1); flex: none;
}
.live-in .btn { margin-left: auto; flex: none; }
body.has-livebar .page { padding-bottom: 100px; }

/* 有底部 Tab 时，操作条叠到 Tab 上方。安全区只让 Tab 负责，避免两层叠加出双倍留白 */
@media (max-width: 859.98px) {
  body.has-tabbar .live-preview {
    bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
    padding-bottom: 10px;
  }
  body.has-tabbar.has-livebar .page {
    padding-bottom: calc(var(--tabbar) + 108px + env(safe-area-inset-bottom));
  }
}

/* PC：变成一条悬浮胶囊，而不是占满整屏的横条 */
@media (min-width: 860px) {
  .live-preview {
    left: 50%; right: auto; transform: translateX(-50%);
    width: min(760px, calc(100% - 48px));
    bottom: 20px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--sh-3);
    padding: 12px 20px;
  }
  .live-in { max-width: none; }
  body.has-livebar .page { padding-bottom: 132px; }
}

/* ============================================================
   14 分段控件
   ============================================================ */
.seg { display: inline-flex; padding: 3px; background: var(--bg-2); border-radius: var(--r-full); gap: 2px; }
.seg button {
  padding: 6px 15px; border-radius: var(--r-full); font-size: 13px; font-weight: 700; color: var(--ink-2);
  transition: .18s var(--ease); white-space: nowrap;
}
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--sh-1); }

/* ============================================================
   15 弹层 / Toast / 空态
   ============================================================ */
.mask {
  position: fixed; inset: 0; z-index: 100; background: rgba(15, 17, 23, .5);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .26s var(--ease);
}
.mask.on { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 101;
  background: var(--card); border-radius: 22px 22px 0 0;
  box-shadow: var(--sh-4);
  transform: translateY(102%); transition: transform .3s var(--ease);
  max-height: 88vh; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.on { transform: translateY(0); }
.sheet-hd {
  padding: 18px 20px 12px; display: flex; align-items: center; gap: 10px; flex: none;
  border-bottom: 1px solid var(--line-2);
}
.sheet-hd .sh-t { font-size: 16.5px; font-weight: 800; }
.sheet-hd .sh-x { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); font-size: 17px; }
.sheet-hd .sh-x:hover { background: var(--bg-2); }
.sheet-bd { padding: 18px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-ft { padding: 12px 20px 18px; border-top: 1px solid var(--line-2); flex: none; }

@media (min-width: 860px) {
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%; width: min(560px, 92vw);
    border-radius: var(--r-lg); transform: translate(-50%, -46%) scale(.96); opacity: 0;
    max-height: 86vh;
  }
  .sheet.on { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.toast-host {
  position: fixed; left: 0; right: 0; top: calc(var(--hdr) + 14px); z-index: 200;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  max-width: min(88vw, 460px);
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--r-full);
  background: rgba(15, 17, 23, .93); color: #fff; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--sh-3);
  animation: toast-in .28s var(--ease);
}
.toast.ok { background: rgba(12, 166, 120, .96); }
.toast.err { background: rgba(224, 49, 49, .96); }
.toast.out { animation: toast-out .24s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px) scale(.96); } }

.empty { padding: 52px 20px; text-align: center; color: var(--ink-3); }
.empty .em-ic { color: var(--ink-4); line-height: 0; margin-bottom: 4px; }
.empty .em-t { font-weight: 700; margin-top: 10px; color: var(--ink-2); }
.empty .em-s { font-size: 12.5px; margin-top: 4px; }

/* ============================================================
   16 分享海报
   ============================================================ */
.poster-stage { display: grid; place-items: center; }
.poster-stage img, .poster-stage canvas {
  width: min(320px, 78vw); border-radius: var(--r); box-shadow: var(--sh-3); display: block;
}
.share-opts { display: grid; gap: 9px; margin-top: 18px; }
.share-opt {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
  text-align: left; transition: .18s var(--ease); width: 100%;
}
.share-opt:hover { border-color: var(--ink-4); transform: translateY(-1px); }
.share-opt .so-ic {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: var(--ink-2); background: var(--bg-2);
}
.share-opt .so-ic.wx { background: #e7f8ee; color: #0ca678; }
.share-opt .so-ic.poster { background: #fff4e6; color: #f76707; }
.share-opt .so-ic.link { background: #eef2ff; color: #4c6ef5; }
/* 标题与副标题必须各占一行，否则会粘成「复制链接http://...」；
 * min-width:0 是让 flex 子项里的长 URL 能被 text-overflow 截断的关键。 */
.share-opt .so-body { flex: 1; min-width: 0; text-align: left; }
.share-opt .so-t { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.35; }
.share-opt .so-s { display: block; font-size: 11.5px; color: var(--ink-3); line-height: 1.45; }
.share-opt .so-go { margin-left: auto; color: var(--ink-4); flex: none; }

/* 微信内「点右上角分享」引导 */
.wx-guide {
  position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, .82);
  display: none; padding: 18px; color: #fff;
}
.wx-guide.on { display: block; }
.wx-guide .wg-arrow { position: absolute; top: 14px; right: 22px; line-height: 0; animation: wg-bounce 1.1s infinite; }
@keyframes wg-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.wx-guide .wg-txt { margin-top: 110px; text-align: center; font-size: 17px; font-weight: 700; line-height: 1.9; }
.wx-guide .wg-txt small { display: block; font-size: 13px; font-weight: 400; color: rgba(255, 255, 255, .7); margin-top: 8px; }

/* ============================================================
   17 骨架屏
   ============================================================ */
.sk { background: linear-gradient(90deg, var(--bg-2) 25%, #f4f5f8 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: var(--r-sm); }
@keyframes sk { to { background-position: -200% 0; } }
.sk-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.sk-item .sk-no { width: 32px; height: 20px; }
.sk-item .sk-l { flex: 1; }
.sk-item .sk-l .sk { height: 12px; margin-bottom: 6px; }
.sk-item .sk-l .sk:last-child { width: 45%; margin-bottom: 0; height: 10px; }
.sk-item .sk-r { width: 46px; height: 24px; }

/* ============================================================
   18 工具类
   ============================================================ */
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap-f { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-28 { margin-top: 28px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-full); font-size: 11.5px; font-weight: 700;
  background: var(--bg-2); color: var(--ink-2);
}
.pill-brand { background: var(--brand-soft); color: var(--brand); }
.pill-ok { background: #e6fcf5; color: #087f5b; }
.pill-warn { background: #fff9db; color: #a17c00; }

/* 「默认」角标：比普通 pill 更轻，只是个提示，不该抢视觉 */
.pill-def {
  background: transparent; border: 1px dashed var(--ink-4); color: var(--ink-3);
  font-size: 10px; font-weight: 700; padding: 0 6px; margin-left: 6px; vertical-align: 1px;
}
.pill-def[hidden] { display: none; }

/* 规则页表格 */
.rtable { font-size: 13px; }
.rtable th, .rtable td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.rtable th { font-weight: 700; color: var(--ink-2); background: #fafbfc; font-size: 12.5px; white-space: nowrap; }
.rtable tr:last-child td { border-bottom: 0; }
.rtable td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rtable-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 打印：把规则页/详情页打出来当分享素材 */
@media print {
  .hdr, .tabbar, .foot, .btn, .toolbar, .live-preview { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ddd; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============================================================
   19 图标与徽章（全站不使用 emoji，见 web/js/icons.js）
   ============================================================ */

/* 内联 SVG 图标基类：颜色一律走 currentColor，所以能跟着父元素变色 */
.ic { display: inline-block; vertical-align: -.16em; flex: none; }

/* 卡片标题里的「图标 + 文字」组合。.card-hd 是 space-between，
   不包一层的话图标会和标题被拉到两端。 */
.hd-ic { display: inline-flex; align-items: center; gap: 8px; }

/* 小号彩色图标块（详情页「上榜成功」「不服来比比」等位置） */
.em-ic-sm {
  display: inline-grid; place-items: center; flex: none;
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--bg-2); color: var(--c1, var(--brand));
}

/* 等级进度格：6 格点亮到当前等级，替代原来的等级 emoji */
.gpips { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.gpips i { width: 3px; height: 11px; border-radius: 1.5px; background: currentColor; opacity: .24; }
.gpips i.on { opacity: 1; }
.gpips-lg { gap: 2.5px; }
.gpips-lg i { width: 4px; height: 14px; border-radius: 2px; }

/* 名次奖牌：奖牌图形是 SVG，名次数字用绝对定位叠在奖牌中央 */
.rank-medal {
  position: relative; display: inline-grid; place-items: center;
  width: var(--rm, 28px); height: var(--rm, 28px); line-height: 0;
}
.rank-medal svg { width: 100%; height: 100%; }
.rank-medal b {
  position: absolute; left: 50%; top: 64%; transform: translate(-50%, -50%);
  font-size: calc(var(--rm, 28px) * .37); font-weight: 900; line-height: 1;
  color: #fff; font-variant-numeric: tabular-nums;
}
.rank-medal.rank-gold { color: #e0a80d; }
.rank-medal.rank-silver { color: #97a3b6; }
.rank-medal.rank-bronze { color: #bd7538; }
.rank-plain { font-size: 16px; font-weight: 900; color: var(--ink-3); letter-spacing: -.03em; }

/* 名次行的「图标 + 文字」小标签（城市、膜拜数等） */
.chip-plain { display: inline-flex; align-items: center; gap: 3px; }

/* Toast 里的图标不要被文字挤压 */
.ic-toast { flex: none; }

/* 领奖台奖牌位在 p1 卡片里放大，其余保持默认 */
.podium-item .rank-medal { --rm: 28px; }
