/* ============ 基础 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #06060c;
  --ink: #eef0ff;
  --muted: #8b8fb0;
  --line: rgba(255, 255, 255, .09);
  --panel: rgba(255, 255, 255, .035);
  --red: #ff4d63;
  --red-2: #ff8a5c;
  --gold: #ffc861;
  --black: #8b6cff;
  --black-2: #4dd8ff;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  overflow-x: hidden;
  max-width: 100vw;
  position: relative;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* 背景光晕 */
.bg-glow {
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(38% 42% at 18% 8%, rgba(255, 77, 99, .20), transparent 70%),
    radial-gradient(36% 40% at 82% 12%, rgba(139, 108, 255, .20), transparent 70%),
    radial-gradient(50% 40% at 50% 105%, rgba(77, 216, 255, .10), transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: breathe 14s ease-in-out infinite alternate;
}

@keyframes breathe {
  from { opacity: .75; transform: scale(1); }
  to   { opacity: 1;   transform: scale(1.06); }
}

/* 地板网格 */
.grid-floor {
  position: fixed;
  left: -50%; right: -50%; bottom: -10%;
  height: 55%;
  background-image:
    linear-gradient(rgba(140, 150, 255, .10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 150, 255, .10) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(520px) rotateX(68deg);
  transform-origin: top center;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40%, transparent 95%);
  mask-image: linear-gradient(to bottom, transparent, #000 40%, transparent 95%);
  pointer-events: none;
  z-index: 0;
}

/* ============ 顶栏 ============ */
.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 40px 14px;
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  font-size: 26px; font-weight: 800;
  color: #12060a;
  background: linear-gradient(140deg, var(--gold), var(--red));
  border-radius: 15px;
  box-shadow: 0 8px 28px rgba(255, 77, 99, .38), inset 0 1px 0 rgba(255, 255, 255, .5);
}

.brand-text h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(92deg, #fff, #ffd9a8 60%, #ffb0a0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text p {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1.5px;
  margin-top: 3px;
}

.meta {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 20px;
  backdrop-filter: blur(8px);
}

.meta-item { display: flex; flex-direction: column; line-height: 1.35; }
.meta-label { font-size: 10px; letter-spacing: 1.6px; color: #6b6f92; }
.meta-item b { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.meta-sep { width: 1px; height: 26px; background: var(--line); }

.live {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 800; letter-spacing: 2px;
  color: #4dffa6;
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4dffa6;
  box-shadow: 0 0 0 0 rgba(77, 255, 166, .7);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(77, 255, 166, .65); }
  70%  { box-shadow: 0 0 0 10px rgba(77, 255, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(77, 255, 166, 0); }
}
.live.off { color: #ff7d7d; }
.live.off .pulse { background: #ff7d7d; animation: none; }

/* ============ 切换 ============ */
.tabs {
  position: relative;
  z-index: 4;
  display: flex;
  gap: 6px;
  margin: 4px auto 0;
  padding: 6px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  width: max-content;
}

.tab {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  color: #9aa0c6;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 12px 34px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .3s;
}
.tab small {
  font-size: 9px;
  letter-spacing: 1.4px;
  opacity: .6;
  padding: 2px 6px;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-weight: 700;
}
.tab-ico { font-size: 17px; filter: saturate(.4) brightness(.9); transition: filter .3s; }
.tab.active { color: #fff; }
.tab.active .tab-ico { filter: none; }

.tab-indicator {
  position: absolute;
  z-index: 1;
  top: 6px; left: 6px;
  height: calc(100% - 12px);
  border-radius: 999px;
  transition:
    transform .45s cubic-bezier(.22, 1.2, .36, 1),
    width .32s cubic-bezier(.22, 1.2, .36, 1),
    background .4s,
    box-shadow .4s;
  background: linear-gradient(120deg, rgba(255, 77, 99, .35), rgba(255, 138, 92, .22));
  box-shadow: 0 0 0 1px rgba(255, 77, 99, .45), 0 10px 30px -8px rgba(255, 77, 99, .6);
}
body[data-kind="black"] .tab-indicator {
  background: linear-gradient(120deg, rgba(139, 108, 255, .38), rgba(77, 216, 255, .2));
  box-shadow: 0 0 0 1px rgba(139, 108, 255, .5), 0 10px 30px -8px rgba(139, 108, 255, .7);
}

/* ============ 擂台 ============ */
.arena {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: stretch;
  padding: 18px 40px 8px;
  min-height: 0;
}

.panel {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
}
.panel.active {
  display: flex;
  animation: panelIn .3s ease-out;
}
@keyframes panelIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.panel-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 0 6px 10px;
}
.panel-head h2 {
  font-size: 19px;
  letter-spacing: 6px;
  font-weight: 800;
}
.panel[data-kind="red"] .panel-head h2 { color: var(--gold); text-shadow: 0 0 26px rgba(255, 200, 97, .45); }
.panel[data-kind="black"] .panel-head h2 { color: #b3a2ff; text-shadow: 0 0 26px rgba(139, 108, 255, .5); }
.panel-desc { font-size: 12px; color: var(--muted); letter-spacing: 1px; }

.podium {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.16fr) minmax(0, 0.92fr);
  gap: 26px;
  align-items: end;
  min-height: 0;
  padding-bottom: 8px;
}

/* 数据不足 3 家时居中摆放，别挤在左边 */
.podium.single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
}
.podium.double {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

/* ---- 卡片 ---- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 26px 20px 24px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, .10);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .018) 40%, rgba(0, 0, 0, .25));
  backdrop-filter: blur(14px);
  overflow: hidden;
  min-height: 0;
  animation: cardIn .55s cubic-bezier(.22, 1.1, .36, 1) backwards;
}
@keyframes cardIn {
  from { transform: translateY(28px) scale(.985); }
  to   { transform: none; }
}

/* 切换红/黑榜时禁用卡片入场动画，避免面板 display 变化导致动画重播、画面闪跳 */
.podium.no-anim .card { animation: none !important; }

.panel[data-kind="red"] .card { height: 84%; box-shadow: inset 0 0 0 1px rgba(255, 77, 99, .06), 0 24px 60px -30px rgba(255, 77, 99, .55); }
.panel[data-kind="red"] .card.r1 { height: 100%; border-color: rgba(255, 200, 97, .5); box-shadow: 0 0 46px -6px rgba(255, 200, 97, .38), inset 0 0 60px -30px rgba(255, 200, 97, .5); }
.panel[data-kind="red"] .card.r2 { height: 88%; }
.panel[data-kind="red"] .card.r3 { height: 82%; }

.panel[data-kind="black"] .card { height: 84%; box-shadow: inset 0 0 0 1px rgba(139, 108, 255, .06), 0 24px 60px -30px rgba(139, 108, 255, .55); }
.panel[data-kind="black"] .card.r1 { height: 100%; border-color: rgba(139, 108, 255, .55); box-shadow: 0 0 46px -6px rgba(139, 108, 255, .45), inset 0 0 60px -30px rgba(139, 108, 255, .55); }
.panel[data-kind="black"] .card.r2 { height: 88%; }
.panel[data-kind="black"] .card.r3 { height: 82%; }

/* 卡片顶部光带 */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 90px;
  background: linear-gradient(180deg, var(--tone-soft), transparent);
  pointer-events: none;
}
.panel[data-kind="red"] .card { --tone: #ff4d63; --tone-soft: rgba(255, 77, 99, .11); }
.panel[data-kind="black"] .card { --tone: #8b6cff; --tone-soft: rgba(139, 108, 255, .11); }

/* 名次角标 */
.medal {
  position: absolute;
  top: 16px; left: 16px;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  border-radius: 13px;
  color: #0b0b12;
  background: linear-gradient(145deg, #fff, #cfd6ff);
  box-shadow: 0 6px 18px -4px rgba(0, 0, 0, .6);
}
.panel[data-kind="red"] .card.r1 .medal { background: linear-gradient(145deg, #fff1c9, var(--gold)); box-shadow: 0 0 22px rgba(255, 200, 97, .7); }
.panel[data-kind="black"] .card.r1 .medal { background: linear-gradient(145deg, #e6e0ff, var(--black)); color: #fff; box-shadow: 0 0 22px rgba(139, 108, 255, .7); }

.crown {
  position: absolute;
  top: -2px; right: 14px;
  font-size: 30px;
  transform: rotate(14deg);
  filter: drop-shadow(0 0 12px rgba(255, 200, 97, .8));
  animation: crownFloat 3.4s ease-in-out infinite;
}
@keyframes crownFloat {
  0%, 100% { transform: rotate(14deg) translateY(0); }
  50%      { transform: rotate(18deg) translateY(-6px); }
}
.panel[data-kind="black"] .crown { filter: drop-shadow(0 0 12px rgba(139, 108, 255, .85)) brightness(1.6); }

/* 头像 */
.avatar {
  position: relative;
  width: 84px; height: 84px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  background: linear-gradient(145deg, #333a5c, #1b1f36);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .14), 0 18px 40px -14px #000;
  flex: none;
}
.card.r1 .avatar { width: 100px; height: 100px; font-size: 32px; }
.panel[data-kind="red"] .avatar { background: linear-gradient(145deg, #5b232c, #2a1015); box-shadow: 0 0 0 2px rgba(255, 77, 99, .6), 0 0 40px -6px rgba(255, 77, 99, .65); }
.panel[data-kind="black"] .avatar { background: linear-gradient(145deg, #2a2350, #131129); box-shadow: 0 0 0 2px rgba(139, 108, 255, .6), 0 0 40px -6px rgba(139, 108, 255, .65); }
.card.r1 .avatar::after {
  content: "";
  position: absolute; inset: -10px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, .22);
  animation: spin 16s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 名字 */
.name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card.r1 .name { font-size: 27px; }

/* 分数 */
.score {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.score b {
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
  background: linear-gradient(180deg, #fff, #c9cfff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.card.r1 .score b { font-size: 68px; }
.panel[data-kind="red"] .card.r1 .score b {
  background: linear-gradient(180deg, #fff5d8, var(--gold) 70%, #ff9d5c);
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 0 22px rgba(255, 200, 97, .35));
}
.panel[data-kind="black"] .score b {
  background: linear-gradient(180deg, #fff, #cfc4ff 60%, #8b6cff);
  -webkit-background-clip: text; background-clip: text;
}
.score i { font-style: normal; font-size: 15px; color: var(--muted); font-weight: 700; }

/* 分数条 */
.bar {
  width: 100%;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .09);
  overflow: hidden;
  margin-top: 2px;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  transition: width 1.1s cubic-bezier(.22, 1, .36, 1);
}
.panel[data-kind="red"] .bar > i { background: linear-gradient(90deg, #ff8a5c, var(--gold)); box-shadow: 0 0 16px rgba(255, 200, 97, .6); }
.panel[data-kind="black"] .bar > i { background: linear-gradient(90deg, #4d8cff, #b18bff); box-shadow: 0 0 16px rgba(139, 108, 255, .6); }

.sub {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .6px;
}
.sub b { color: #c9cdf0; font-weight: 700; }

/* ============ 弹幕 ============ */
.danmaku-layer {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

.dm {
  position: absolute;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
  padding: 2px 6px;
  letter-spacing: .4px;
  color: #fff;
  opacity: .93;
  text-shadow:
    0 0 6px rgba(0, 0, 0, .95),
    0 1px 4px rgba(0, 0, 0, .9),
    0 0 14px rgba(0, 0, 0, .8);
  will-change: transform;
  animation: dmFly linear forwards;
}
.dm.red    { color: #ffb38a; }
.dm.gold   { color: #ffd98a; }
.dm.purple { color: #c3b0ff; }
.dm.cyan   { color: #a8e8ff; }

@keyframes dmFly {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-100vw - 100%)); }
}

/* ============ 底栏 ============ */
.footbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 40px 16px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .8px;
}
.foot-hint b { color: #c9cdf0; }

.refresh-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #d7dbff;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 20px;
  cursor: pointer;
  transition: .25s;
}
.refresh-btn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); }
.refresh-btn:active { transform: scale(.97); }
.refresh-btn[disabled] { opacity: .5; cursor: progress; }

/* 空状态 */
.empty {
  flex: 1;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
  line-height: 2;
}

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
  .topbar { padding: 16px 20px 10px; }
  .arena { padding: 10px 20px 4px; }
  .footbar { padding: 4px 20px 12px; }
  .podium { gap: 14px; }
  .card { padding: 20px 14px; }
  .name { font-size: 18px; }
  .card.r1 .name { font-size: 22px; }
  .score b { font-size: 42px; }
  .card.r1 .score b { font-size: 50px; }
  .meta { gap: 10px; padding: 7px 14px; }
  .tab { padding: 10px 20px; font-size: 14px; }
}

@media (max-width: 720px) {
  body { overflow-y: auto; }

  .topbar {
    padding: 12px 14px 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .brand { gap: 10px; }
  .brand-mark { width: 40px; height: 40px; font-size: 20px; border-radius: 12px; }
  .brand-text h1 { font-size: 17px; letter-spacing: 1px; }
  .brand-text p { font-size: 10px; letter-spacing: .5px; margin-top: 1px; }
  .meta {
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 6px 12px;
    gap: 4px 14px;
    font-size: 11px;
  }
  .meta-label { font-size: 9px; letter-spacing: .8px; }
  .meta-item b { font-size: 12px; }
  .meta-sep { display: none; }

  .tabs { margin: 2px auto 0; padding: 4px; }
  .tab { padding: 9px 16px; font-size: 13px; letter-spacing: 1px; gap: 5px; }
  .tab small { font-size: 8px; padding: 1px 4px; }
  .tab-ico { font-size: 14px; }
  .tab-indicator { top: 4px; left: 4px; height: calc(100% - 8px); }

  .arena { padding: 8px 12px 4px; justify-content: center; }
  .panel-head { padding: 0 2px 6px; gap: 8px; }
  .panel-head h2 { font-size: 15px; letter-spacing: 3px; }
  .panel-desc { font-size: 10px; }

  /* 手机端奖台：第一名独占一行居中，二三名在下面左右 */
  .podium {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    align-content: start;
    flex: none;
    padding-bottom: 2px;
  }
  .card,
  .panel[data-kind="red"] .card,
  .panel[data-kind="black"] .card {
    height: auto !important;
    min-height: 168px;
    padding: 16px 10px 14px;
    border-radius: 18px;
    gap: 7px;
  }
  .card.r1 { grid-column: 1 / -1; grid-row: 1; min-height: 210px; }
  .card.r2 { grid-column: 1; grid-row: 2; }
  .card.r3 { grid-column: 2; grid-row: 2; }

  .medal { top: 10px; left: 10px; width: 32px; height: 32px; font-size: 14px; border-radius: 10px; }
  .crown { font-size: 22px; right: 10px; }
  .avatar { width: 56px; height: 56px; font-size: 19px; }
  .card.r1 .avatar { width: 66px; height: 66px; font-size: 22px; }
  .name { font-size: 14px; letter-spacing: .5px; white-space: normal; line-height: 1.25; }
  .card.r1 .name { font-size: 17px; }
  .score b { font-size: 32px; letter-spacing: -1px; }
  .card.r1 .score b { font-size: 40px; }
  .score i { font-size: 11px; }
  .sub { font-size: 9px; gap: 6px; }
  .bar { height: 6px; }

  .footbar { padding: 4px 14px 12px; font-size: 10px; }
  .refresh-btn { padding: 7px 14px; font-size: 11px; }

  .dm { font-size: 12px; }

  .tab-indicator {
    transition:
      transform .26s cubic-bezier(.22, 1, .36, 1),
      width .24s cubic-bezier(.22, 1, .36, 1),
      background .3s,
      box-shadow .3s;
  }

  /* 手机端弹层全屏 */
  .modal { padding: 0; }
  .modal-panel { width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; }
  .modal-body { padding: 22px 16px 18px; }
  .detail-title h2 { font-size: 18px; }
  .detail-head { gap: 12px; }
  .detail-head .avatar { width: 54px; height: 54px; font-size: 18px; }
  .lb-cols, .lb-row { grid-template-columns: 38px 1fr 62px 40px; gap: 6px; }
  .lb-row { padding: 10px 8px; font-size: 12.5px; }
  .lb-cols { padding: 0 8px; }
  .card-hint { display: none; }
  .meta-action { border-left: 0; padding-left: 0; margin-left: auto; }
}

/* ================= 弹层（店铺详情 / 总榜） ================= */
body.modal-open { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 10, .74);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .2s;
}
.modal.show .modal-backdrop { opacity: 1; }

.modal-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: min(86vh, 880px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #17171f, #0b0b12);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 24px;
  box-shadow: 0 40px 120px -30px #000;
  transform: translateY(16px) scale(.98);
  opacity: 0;
  transition: transform .28s cubic-bezier(.22, 1, .36, 1), opacity .2s;
  overflow: hidden;
}
.modal.show .modal-panel { transform: none; opacity: 1; }

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: #cfd3f0;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.modal-close:hover { background: rgba(255, 255, 255, .16); color: #fff; }

.modal-body {
  overflow-y: auto;
  padding: 28px 28px 22px;
  overscroll-behavior: contain;
}

/* 店铺详情 */
.detail-head { display: flex; gap: 16px; align-items: center; padding-right: 44px; }
.detail-title { flex: 1; min-width: 0; }
.detail-title h2 { font-size: 22px; line-height: 1.3; word-break: break-word; }
.detail-sub { font-size: 12px; color: var(--muted); margin: 7px 0 11px; line-height: 1.6; }
.detail-sub b { color: #fff; font-size: 13px; }

.comments-head { margin: 22px 0 10px; font-size: 14px; letter-spacing: 1px; color: #cfd3f0; font-weight: 700; }
.comments-head span { font-size: 11px; color: var(--muted); margin-left: 6px; font-weight: 400; }

.comment-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.comment-item {
  position: relative;
  padding: 12px 14px 12px 30px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .07);
  font-size: 13.5px;
  line-height: 1.7;
  color: #dcdef3;
  word-break: break-word;
}
.comment-item::before {
  content: "“";
  position: absolute;
  left: 11px; top: 5px;
  font-size: 20px;
  line-height: 1;
  color: rgba(255, 255, 255, .22);
}
.comment-item .hl { font-style: normal; color: var(--gold); font-weight: 700; }
.comment-item .other { color: #767b98; }
.comment-empty {
  color: var(--muted);
  padding: 18px 0;
  font-size: 13px;
  text-align: center;
}
.detail-foot { margin-top: 18px; font-size: 11px; color: #6b6f92; text-align: center; }

/* 总榜 */
.modal-head { padding-right: 44px; }
.modal-head h2 { font-size: 21px; letter-spacing: 1px; }
.modal-head p { font-size: 12px; color: var(--muted); margin-top: 7px; }
.modal-head p b { color: #fff; }

.lb-cols, .lb-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 76px 56px;
  align-items: center;
  gap: 8px;
}
.lb-cols {
  margin: 18px 0 6px;
  padding: 0 12px;
  font-size: 10px;
  letter-spacing: 1.2px;
  color: #6b6f92;
}
.lb-cols span:nth-child(3),
.lb-cols span:nth-child(4) { text-align: right; }

.lb-list { display: flex; flex-direction: column; gap: 4px; }
.lb-row {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, .03);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}
.lb-row:hover { background: rgba(255, 255, 255, .085); border-color: rgba(255, 255, 255, .14); }
.lb-row:active { transform: scale(.995); }
.lb-rank { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }
.lb-cmts { text-align: right; font-size: 11px; color: var(--muted); }

/* 卡片可点击 + 右上角总榜入口 */
.card.clickable { cursor: pointer; transition: transform .25s, border-color .25s, box-shadow .25s; }
.card.clickable:hover { transform: translateY(-6px); border-color: rgba(255, 255, 255, .3); }
.card.clickable:active { transform: translateY(-2px) scale(.995); }
.card.clickable:focus-visible { outline: 2px solid rgba(255, 255, 255, .55); outline-offset: 3px; }
.card-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, .5);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
  white-space: nowrap;
}
.card.clickable:hover .card-hint { opacity: 1; }

.meta { cursor: pointer; transition: background .22s, border-color .22s; }
.meta:hover { background: rgba(255, 255, 255, .075); border-color: rgba(255, 255, 255, .24); }
.meta:focus-visible { outline: 2px solid rgba(255, 255, 255, .5); outline-offset: 2px; }
.meta-action {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  white-space: nowrap;
}
.meta-action b { font-size: 14px; color: var(--gold); font-variant-numeric: tabular-nums; }
.meta-action-arrow { font-size: 17px; color: rgba(255, 255, 255, .55); line-height: 1; }

/* 底部按钮组 */
.foot-actions { display: flex; align-items: center; gap: 8px; }
.share-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffd9a8;
  background: rgba(255, 200, 97, .1);
  border: 1px solid rgba(255, 200, 97, .35);
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  transition: .25s;
}
.share-btn:hover { background: rgba(255, 200, 97, .18); border-color: rgba(255, 200, 97, .6); }
.share-btn:active { transform: scale(.97); }

.cookie-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #a8d8ff;
  background: rgba(77, 216, 255, .1);
  border: 1px solid rgba(77, 216, 255, .3);
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  transition: .25s;
  align-items: center;
}
.cookie-btn:hover { background: rgba(77, 216, 255, .18); border-color: rgba(77, 216, 255, .55); }

.cookie-steps {
  font-size: 12px;
  color: #b8bcd8;
  line-height: 1.95;
  padding-left: 20px;
  margin: 14px 0 12px;
}
.cookie-steps b { color: #ffd98a; font-weight: 700; }
.cookie-input {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  box-sizing: border-box;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.65;
  word-break: break-all;
}
.cookie-input:focus { outline: none; border-color: rgba(255, 255, 255, .38); }
.cookie-input.err { border-color: #ff6b6b; }

/* 二维码弹层 */
.qr-wrap {
  display: grid;
  place-items: center;
  margin: 18px auto 12px;
  padding: 16px;
  background: #fff;
  border-radius: 18px;
  width: max-content;
  box-shadow: 0 20px 60px -20px #000;
}
.qr-wrap svg { width: 240px; height: 240px; display: block; }
.qr-fail { color: #333; padding: 20px; }
.qr-url {
  text-align: center;
  font-size: 12px;
  color: #cfd3f0;
  word-break: break-all;
  user-select: all;
  font-family: ui-monospace, Consolas, monospace;
  padding: 0 8px;
}
.qr-tip { text-align: center; font-size: 11px; color: #6b6f92; margin-top: 8px; line-height: 1.6; }
.qr-actions { margin-top: 16px; display: flex; justify-content: center; }
.qr-copy {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ink);
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  padding: 10px 30px;
  cursor: pointer;
  transition: .2s;
  white-space: nowrap;
}
.qr-copy:hover { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .3); }
.qr-copy:active { transform: scale(.98); }

@media (max-width: 720px) {
  .qr-wrap svg { width: 200px; height: 200px; }
  .qr-wrap { padding: 12px; }
  .share-btn { padding: 7px 14px; font-size: 11px; }
  .foot-actions { gap: 6px; }
}
