/* Online-only ranking update: controls stay outside the exported long image. */
.ranking-top-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ranking-limit-control {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 4px;
  border: 1px solid #d7d6cf;
  border-radius: 9px;
  background: #fbfbf8;
  color: #625f55;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.ranking-limit-control > span { padding: 0 9px 0 7px; }
.ranking-limit-control > em { padding: 0 7px 0 6px; color: #8d897e; font-style: normal; }
.ranking-limit-control button {
  width: 40px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #58564f;
  font-size: 13px;
  font-weight: 900;
}
.ranking-limit-control button:hover { background: #ebe9df; }
.ranking-limit-control button.active { background: #171713; color: #ffd438; box-shadow: 0 2px 5px rgba(0, 0, 0, .18); }

/* Do not crop a 30/50-row export. The footer follows the final row naturally. */
.rank-poster-board {
  aspect-ratio: auto !important;
  min-height: 0 !important;
  background-repeat: repeat-y;
  background-size: 100% auto;
  background-position: top center;
}
.ranking-poster-content {
  width: 100% !important;
  padding: 26px 31px 0 !important;
  transform: none !important;
}
.rank-poster-board .rank-footer { margin-top: 18px; }

/* 成图以 2x 导出：16px CSS 对应约 32px 成图文字，不改行高或各行位置。 */
.rank-poster-board .ranking-poster-heading h2 { font-size: 66px; }
.rank-poster-board .ranking-poster-heading b { font-size: 17px; }
.rank-poster-board .ranking-poster-heading small { font-size: 15px; }
.rank-poster-board .top-copy h3 { font-size: 24px; font-weight: 1000; }
.rank-poster-board .top-copy p,
.rank-poster-board .top-copy p.top-location {
  font-size: 16px;
  font-weight: 1000;
}
.rank-poster-board .top-copy strong,
.rank-poster-board .top-1 .top-copy strong { font-size: 42px; }
.rank-poster-board .top-copy strong small { font-size: 15px; }
.rank-poster-board .rank-list-heading { font-size: 16px; font-weight: 1000; }
.rank-poster-board .rank-row strong,
.rank-poster-board .rank-row > span {
  font-size: 16px;
  font-weight: 1000;
}
.rank-poster-board .rank-row > b { font-size: 16px; }
.rank-poster-board .rank-row em { font-size: 26px; }
.rank-poster-board .rank-footer span { font-size: 21px; font-weight: 1000; }
.rank-poster-board .rank-footer small { font-size: 10px; }
.rank-poster-board .rank-footer > em { font-size: 22px; }

@media (max-width: 700px) {
  .app-shell { display: block; min-height: 100dvh; }
  .side-nav {
    position: sticky;
    z-index: 10;
    top: 0;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 8px 12px 10px;
    overflow: hidden;
  }
  .brand-lockup { height: 38px; padding: 0 3px; font-size: 18px; }
  .brand-lockup b, .nav-caption, .nav-help { display: none; }
  .side-nav nav { display: flex; gap: 6px; width: max-content; padding-top: 7px; overflow-x: auto; }
  .nav-item { flex: none; width: auto; min-height: 42px; padding: 0 13px; gap: 7px; border-radius: 7px; font-size: 14px; }
  .nav-item svg { width: 17px; height: 17px; }
  .main-content { padding: 20px 12px 34px; }
  .workspace-header { margin-bottom: 17px; }
  .workspace-header h1 { margin-top: 5px; font-size: 31px; letter-spacing: -1px; }
  .eyebrow { font-size: 11px; letter-spacing: 1.4px; }
  .rank-workspace { width: 100%; }
  .work-actions { gap: 12px; margin-bottom: 12px; }
  .ranking-top-actions { width: 100%; margin-left: 0; }
  .ranking-limit-control { min-height: 52px; }
  .ranking-limit-control > span, .ranking-limit-control > em { font-size: 16px; }
  .ranking-limit-control button { width: 49px; height: 41px; font-size: 17px; }
  .action-group .secondary-btn, .action-group .primary-btn { min-height: 50px; font-size: 14px; }
  .rank-board-wrap { padding: 6px; border: 0; background: #cfcfc7; box-shadow: 0 14px 32px rgba(44, 42, 30, .15); }
  .rank-poster-board { width: 100%; min-width: 0; }
  .ranking-poster-content { padding: 23px 18px 0 !important; }
  .ranking-poster-brand { width: 190px; }
  .ranking-poster-code { top: 26px; right: 18px; font-size: 16px; }
  .ranking-poster-heading { padding-top: 34px; }
  .ranking-poster-heading h2 { font-size: clamp(42px, 12vw, 56px); letter-spacing: -3px; }
  .ranking-poster-heading > div { width: 94%; gap: 8px; margin: 17px auto 20px; padding: 8px 0; }
  .ranking-poster-heading b { font-size: 14px; letter-spacing: 2px; }
  .ranking-poster-heading small { font-size: 13px; }
  .rank-poster-board .rank-top-three { gap: 4px; padding: 20px 0 22px; }
  .rank-poster-board .top-visual { height: clamp(144px, 43vw, 184px); }
  .rank-poster-board .top-1 .top-visual { height: clamp(180px, 54vw, 230px); }
  .rank-poster-board .top-copy { min-height: 122px; padding: 9px 6px 8px; }
  .rank-poster-board .top-copy h3 { margin-top: -21px; padding: 5px 3px; font-size: 18px; }
  .rank-poster-board .top-copy p, .rank-poster-board .top-copy p.top-location { font-size: 14px; }
  .rank-poster-board .top-details { gap: 6px; padding-top: 6px; }
  .rank-poster-board .top-copy strong, .rank-poster-board .top-1 .top-copy strong { font-size: 30px; }
  .rank-poster-board .top-copy strong small { font-size: 12px; }

  /* 手机上只保留可扫读的三列，避免五列挤压造成小字号。 */
  .rank-poster-board .rank-list-heading {
    grid-template-columns: 38px minmax(0, 1fr) minmax(80px, auto);
    gap: 8px;
    height: 44px;
    padding: 0 10px;
    font-size: 14px;
  }
  .rank-poster-board .rank-list-heading span:nth-child(3),
  .rank-poster-board .rank-list-heading span:nth-child(4) { display: none; }
  .rank-poster-board .rank-row {
    grid-template-columns: 38px minmax(0, 1fr) minmax(80px, auto);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1px 8px;
    min-height: 58px;
    padding: 7px 10px;
    font-size: 12px;
  }
  .rank-poster-board .rank-row > b {
    grid-column: 1;
    grid-row: 1 / 3;
    width: 27px;
    height: 27px;
    align-self: center;
    font-size: 15px;
  }
  .rank-poster-board .rank-row strong {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    font-size: 16px;
    line-height: 1.15;
  }
  .rank-poster-board .rank-row > span:first-of-type {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    font-size: 13px;
    line-height: 1.15;
  }
  .rank-poster-board .rank-row > span:nth-of-type(2) { display: none; }
  .rank-poster-board .rank-row em {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
    font-size: 22px;
  }
  .rank-poster-board .rank-footer { height: 84px; margin: 16px -18px 0; padding: 15px 19px; }
  .rank-poster-board .rank-footer > div { grid-template-columns: 49px 1fr; column-gap: 9px; }
  .rank-poster-board .rank-footer b { width: 44px; height: 44px; font-size: 22px; }
  .rank-poster-board .rank-footer span { font-size: 18px; letter-spacing: .6px; }
  .rank-poster-board .rank-footer small { font-size: 9px; letter-spacing: .45px; }
  .rank-poster-board .rank-footer > em { right: 13px; bottom: 19px; font-size: 18px; letter-spacing: 1.7px; }
}
