/* 容易认错排行榜 — builds on style.css tokens and home.css (header, footer, .btn, .disclaimer) */

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------------- intro */
.rank main > section { margin-top: 56px; }
.rank main > .intro { margin-top: 24px; max-width: 760px; }
.intro h1 { font-size: clamp(32px, 4.4vw, 52px); letter-spacing: 0.05em; }
.intro .lede { margin-top: 14px; }
.formula { margin: 14px 0 0; color: var(--ink-soft); font-size: 15px; }
.formula b { color: var(--ink); }
.intro .disclaimer { margin: 20px 0 0; }
.intro .disclaimer b { display: block; font-family: var(--serif); font-size: 17px; margin-bottom: 2px; }

/* ---------------- the two boards */
.boards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; }
.board-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding-bottom: 10px; border-bottom: 1.5px solid var(--ink); }
.home .board-head h2 { margin: 0; font-size: 28px; }
.board-head p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.rk { font: 700 26px/1.2 var(--serif); text-align: center; }
.row:first-child .rk { font-size: 32px; }
.pr { margin: 0; line-height: 1.5; }
.pr b { font-family: var(--serif); font-size: 19px; }
.pr i { font-size: 14px; color: var(--ink-soft); }
.pr .nm:last-of-type { font-family: var(--serif); font-size: 17px; }
/* home.css keeps .nm on one line; the 学名 part here must wrap, the 中文名 must not */
.pr .nm:first-child { white-space: normal; }
.pr b { white-space: nowrap; }
.chip {
  display: inline-block; margin-left: 4px; padding: 0 8px; border-radius: 999px;
  font-size: 13px; line-height: 22px; white-space: nowrap; vertical-align: 2px;
  background: var(--paper-deep); color: var(--ink); text-decoration: none;
}
a.chip { border: 1px solid var(--ink); position: relative; }
a.chip:hover { text-decoration: underline; }
a.chip::after, .rank .ref::after { content: ""; position: absolute; inset: -11px -4px; } /* ≥44px tap area, no visual change */
.rank .ref { position: relative; margin-left: 4px; }
.chip-quiet { border: 1px dashed var(--ink); background: none; color: var(--ink-soft); }

.st { margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; font-size: 15px; color: var(--ink-soft); }
.st div { display: flex; align-items: baseline; gap: 4px; }
.st dt { font-size: 14px; }
.st dd { margin: 0; font: 700 17px/1.3 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.st .per { margin-left: auto; font-size: 14px; }
.board-note { margin: 12px 0 0; font-size: 15px; color: var(--ink-soft); }

/* ---------------- honesty note */
.honest { max-width: 760px; }
.honest h2 { font-size: 24px; }
.honest p { margin: 0; }
.honest .later { margin-top: 12px; color: var(--ink-soft); }

/* ---------------- vote */
.vote { max-width: 760px; }
.vote-rule { margin: -10px 0 18px; color: var(--ink-soft); }
.vote fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.cands { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cand {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px;
  min-height: 52px; padding: 8px 14px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 8px; background: var(--paper);
}
.cand:hover { border-color: var(--ink); }
.cand input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.cand-name { font-family: var(--serif); font-size: 17px; font-weight: 700; }
.cand-name .vs { font-family: var(--sans); font-size: 14px; }
.cand-tag { margin-left: 4px; font: 400 12px/1.4 var(--sans); color: var(--ink-soft); white-space: nowrap; }
.cand .bar { grid-column: 2 / 3; height: 8px; border-radius: 4px; background: var(--paper-deep); overflow: hidden; }
.cand .bar span { display: block; height: 100%; background: var(--ink-soft); transform: scaleX(0); transform-origin: left; transition: transform 0.4s ease; }
.cand .cnt { grid-column: 3; font-size: 14px; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cand:has(input:checked) { border-color: var(--ink); background: var(--paper-deep); }
.cand input:focus-visible { outline: none; }
.cand:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.cand.off { cursor: default; }
.cand.off:hover { border-color: var(--line); }
.cand.mine { border-color: var(--ink); }
.cand.mine .bar span { background: var(--accent); }
.mine-tag { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.mine-tag::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-right: 6px; vertical-align: 0.08em;
}
.vote-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; }
.vote-foot .btn { cursor: pointer; font-family: inherit; color: var(--paper); }
.vote-foot .btn:disabled { cursor: not-allowed; background: var(--paper-deep); color: var(--ink-soft); border-color: var(--line); }
.vote-foot .btn[hidden] { display: none; }
.vote-status { margin: 0; color: var(--ink-soft); font-size: 15px; }

/* ---------------- phone */
@media (max-width: 900px) {
  .boards { grid-template-columns: 1fr; gap: 48px; }
}
@media (max-width: 640px) {
  .rank main { padding: 0 16px; }
  .rank main > section { margin-top: 48px; }
  .row { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
  .rk { font-size: 22px; text-align: left; }
  .row:first-child .rk { font-size: 26px; }
  .st .per { margin-left: 0; }
  .cand { padding: 8px 12px; column-gap: 10px; }
  .cand-name { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .cand .bar span { transition: none; }
}
