/*
 * 热榜聚合 — /rebang/, other platforms' rankings, grouped 大陆 / 台港 / 海外.
 *
 * HAND-WRITTEN, NOT GENERATED. chrome.css, submit.css, fanqiang.css,
 * after-the-wall.css, home-skins.css, source-profile.css and wenku-skins.css
 * are built by scripts/build-*.sh and an edit to any of them is reverted by the
 * next build (scripts/check-builds-idempotent.sh exists because that happened
 * twice on 2026-08-30). This file is its own, loaded only on /rebang/.
 *
 * EXTENDS THE PAPER, DOES NOT RESTATE IT. Every colour is an existing token
 * (--ink, --ink-2, --rule, --rule-strong, --accent, --bg), so dark mode comes
 * free: theme-dark.css re-binds those names site-wide and this file inherits
 * the rebinding. The --mh-* family is FRONT-PAGE ONLY and must not appear here.
 * Fallbacks mirror chrome.css so a token-less context still renders.
 *
 * ------------------------------------------------------------------------
 * THE GROUPING IS THE LAYOUT, AND THAT IS THE WHOLE POINT OF THE PAGE
 * ------------------------------------------------------------------------
 * No other Chinese-language attention board carries non-mainland channels.
 * Ours does, and a reader has to SEE that without doing anything: 大陆, 台港
 * and 海外 stand side by side, as columns, at a glance. A tab strip or a
 * filter would hide the one thing this page has that tophub does not.
 *
 * So `.hotl-groups` is a grid whose column count comes from `data-n`, written
 * by the renderer as the number of groups that actually have panels today. An
 * empty group is never rendered, so the grid never carries a headed void — the
 * blank space the owner has objected to three times.
 *
 * THE ONE-GROUP CASE IS DIFFERENT ON PURPOSE. While only 大陆 has channels,
 * a single column of panels down the left of a 1080px page would be a third of
 * a page and two thirds of nothing. At data-n="1" the lone group spreads its
 * OWN panels across the width by multicol instead. Multicol rather than grid,
 * for the reason hot.css records: a grid with fixed rows leaves column two
 * empty whenever the content is short, multicol balances.
 *
 * PHONE TIER IS LAST IN THE FILE AND MUST STAY LAST — chrome.css, deep.css and
 * home-rescue.css guard theirs the same way. Append new rules ABOVE the banner.
 */

.mh-hotl {
  /* A Bricks custom element renders inside a flex child that claims no width
     of its own, and max-width caps a width never claimed — ten desk indexes
     rendered ten different widths before this was understood. */
  width: 100%;
  max-width: 68em;
  margin: 0 auto;
  padding: 0 0 8px;
}

/* ---------------------------------------------------------------- masthead */

.hotl-k {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink, #1a1a18);
}

.hotl-k .zh {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink, #1a1a18);
}

.hotl-k .en {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--ink-2, #5c5c56);
}

.hotl-lede {
  margin: 14px 0 0;
  max-width: 46em;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-2, #5c5c56);
}

/* ------------------------------------------------------------------ groups */

.hotl-groups {
  display: grid;
  gap: 0 34px;
  /* Columns are their own height. Without this a short 台港 column would be
     stretched to the height of a long 大陆 one and its hairline rules would
     float in space. */
  align-items: start;
  margin-top: 26px;
}

.hotl-groups[data-n="1"] { grid-template-columns: 1fr; }
.hotl-groups[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hotl-groups[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Four groups at 1080px would be 250px each, which is narrower than a headline
   reads. Two rows of two keeps the contrast and keeps the column legible. */
.hotl-groups[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* The vertical rule between group columns. On the wrapper's children rather
   than as a column-rule, because the grid is a grid and not a multicol; the
   :first-child exemption is what stops a rule appearing at the page edge. */
.hotl-g {
  min-width: 0;
  padding-left: 34px;
  border-left: 1px solid var(--rule, #e3e1da);
}

.hotl-groups[data-n="1"] .hotl-g,
.hotl-g:first-child {
  padding-left: 0;
  border-left: 0;
}

/* Second row of the 2x2 case: the left-hand cell is at the page edge too. */
.hotl-groups[data-n="4"] .hotl-g:nth-child(3) {
  padding-left: 0;
  border-left: 0;
}

.hotl-gk {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0 0 4px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent, #1e6b4e);
}

.hotl-gk .zh {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink, #1a1a18);
}

.hotl-gk .en {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2, #5c5c56);
}

/* One group alone: its panels take the width rather than the page taking the
   emptiness. See the file docblock. */
.hotl-groups[data-n="1"] .hotl-panels {
  -webkit-columns: 3;
  columns: 3;
  -webkit-column-gap: 34px;
  column-gap: 34px;
}

.hotl-groups[data-n="2"] .hotl-panels {
  -webkit-columns: 2;
  columns: 2;
  -webkit-column-gap: 30px;
  column-gap: 30px;
}

/* ------------------------------------------------------------------ panels */

.hotl-p {
  /* A panel must never be split across two multicol columns: half a ranking
     under the next channel's name is worse than a short column. */
  -webkit-column-break-inside: avoid;
  break-inside: avoid;
  page-break-inside: avoid;
  padding: 20px 0 4px;
}

.hotl-pk {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0 0 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-strong, #c9c6bc);
}

.hotl-pn {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink, #1a1a18);
}

/* A FIXED STAMP, NEVER A TICKING ONE (ADR-0010 ruling 1). The renderer prints
   a date and an hour; nothing here counts. */
.hotl-pt {
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--ink-2, #5c5c56);
}

/* Said in words as well as in grey: a colour is not a statement, and a reader
   on a phone in daylight sees no colour at all. */
.hotl-po {
  padding: 1px 6px;
  border: 1px solid var(--rule-strong, #c9c6bc);
  border-radius: 2px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-2, #5c5c56);
}

.hotl-p.is-stale .hotl-pn { color: var(--ink-2, #5c5c56); }
.hotl-p.is-stale .hotl-l { opacity: 0.62; }

/* -------------------------------------------------------------------- rows */

.hotl-l {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: hotl;
}

.hotl-l li {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0 7px 26px;
  border-bottom: 1px solid var(--rule, #e3e1da);
}

/* The rank. A counter rather than the <ol> marker so the figure can carry its
   own weight; the element is still an <ol>, so a screen reader is told this is
   a ranking whatever the marker looks like. */
.hotl-l li::before {
  counter-increment: hotl;
  content: counter(hotl);
  position: absolute;
  left: 0;
  top: 8px;
  width: 20px;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--rule-strong, #c9c6bc);
}

.hotl-l li:nth-child(-n+3)::before { color: var(--accent, #1e6b4e); }

/* EVERY ROW LEAVES THE SITE. The anchor is the title and only the title
   (owner ruling 2026-08-15): row chrome hangs on the <li>, so the dead space
   after a short headline stays dead. */
.hotl-a {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink, #1a1a18);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.hotl-a:hover,
.hotl-a:focus-visible { border-bottom-color: var(--accent, #1e6b4e); }

/* The platform's own figure, in the platform's own units. Never a number of
   ours, and never comparable across panels — the note says so. */
.hotl-h {
  flex: 0 0 auto;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: var(--ink-2, #5c5c56);
}

/* -------------------------------------------------------------------- foot */

.hotl-note {
  margin: 30px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--rule, #e3e1da);
  max-width: 46em;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-2, #5c5c56);
}

/* A NAMED ABSENCE, not a silent one. A channel that stops answering and simply
   vanishes is how nobody notices for a week. */
.hotl-gone {
  margin: 8px 0 0;
  max-width: 46em;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-2, #5c5c56);
}

/* ------------------------------------------------------------------ */
/* TABLET TIER. Three group columns stop reading at about 980px.       */
/* ------------------------------------------------------------------ */
@media (max-width: 1000px) {
  .hotl-groups[data-n="3"],
  .hotl-groups[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .hotl-groups[data-n="3"] .hotl-g:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .hotl-groups[data-n="1"] .hotl-panels {
    -webkit-columns: 2;
    columns: 2;
  }
}

/* ------------------------------------------------------------------ */
/* PHONE TIER — KEEP LAST. Append new rules ABOVE this banner.         */
/* ------------------------------------------------------------------ */
@media (max-width: 760px) {
  /* One column of everything. The groups stay in their editorial order, so a
     reader scrolling a phone still meets 大陆, then 台港, then 海外 — the
     contrast survives the narrow screen as a sequence instead of a row. */
  .hotl-groups[data-n="1"],
  .hotl-groups[data-n="2"],
  .hotl-groups[data-n="3"],
  .hotl-groups[data-n="4"] {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .hotl-g {
    padding-left: 0;
    padding-top: 4px;
    border-left: 0;
  }

  .hotl-groups[data-n="1"] .hotl-panels,
  .hotl-groups[data-n="2"] .hotl-panels {
    -webkit-columns: 1;
    columns: 1;
  }

  .hotl-k .zh { font-size: 22px; }
  .hotl-lede { font-size: 14px; }
  .hotl-gk { margin-top: 20px; }
  .hotl-gk .zh { font-size: 16px; }
  .hotl-p { padding-top: 16px; }
  .hotl-pn { font-size: 14.5px; }
  .hotl-l li { padding: 9px 0 8px 24px; }
  .hotl-l li::before { top: 9px; width: 19px; }
  .hotl-a { font-size: 14.5px; line-height: 1.55; }
}
