/* FRANK RADAR 新歌週榜：公開頁
   色彩與字體：紙色底、墨色字、明體標題、單一藍色強調；本檔自足，不引用其他站的檔案。
   版面語彙：印刷品上的排行榜版面——細線表格、等寬數字、欄線與留白構成層級。
   不用卡片、漸層、陰影；圓角最多 2px；固定淺色；不載入任何外部字型。 */
:root {
  color-scheme: light only;
  --paper: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6b6963;      /* 對紙色 5.2:1，次要文字也過 WCAG AA */
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --accent: #1c5cab;
  --serif: "Songti TC", "Noto Serif TC", "Songti SC", serif;
  --sans: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;

  /* 桌機表格欄寬：序｜歌名｜藝人｜發行｜上榜｜七個平台｜展開 */
  --cols: 2.6rem minmax(0, 2.3fr) minmax(0, 1.35fr) 6.4rem 3.2rem repeat(7, 4.4rem) 1.6rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

.page { max-width: 1200px; margin: 0 auto; padding: 0 32px 64px; }

/* ——— 草稿橫條 ——— */
.draft-bar {
  background: var(--ink); color: var(--paper);
  font-weight: 600; font-size: 15px; letter-spacing: 0.04em;
  padding: 10px 32px; text-align: left;
}

/* ——— 刊頭（報頭式，一行一行排） ——— */
.masthead {
  padding: 36px 0 18px;
  border-bottom: 4px double var(--ink);
}
.masthead .title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(30px, 5.4vw, 54px);
  line-height: 1.12;
  letter-spacing: 0.03em;
  word-break: keep-all;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
}
.masthead .tagline { color: var(--ink-2); margin-top: 10px; font-size: 15px; }
.issue-meta { margin-top: 10px; font-size: 15px; }
.issue-meta div {
  display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 12px;
  padding: 5px 0; border-bottom: 1px solid var(--grid);
}
.issue-meta div:last-child { border-bottom: 0; }
.issue-meta dt { color: var(--ink-2); }
.issue-meta dd { font-variant-numeric: tabular-nums; }

/* ——— 章節 ——— */
main > section { margin-top: 44px; }
main > section:first-child { margin-top: 28px; }
main h2 {
  font-family: var(--serif); font-weight: 700; font-size: 23px; line-height: 1.3;
  border-top: 2px solid var(--ink); padding-top: 10px;
}
.sec-note { color: var(--ink-2); font-size: 14.5px; margin-top: 4px; }
.empty { margin-top: 28px; color: var(--ink-2); }

.lede p {
  font-family: var(--serif); font-size: 19px; line-height: 1.9;
  max-width: 36em; margin-top: 12px;
}

/* ——— 名次表 ——— */
.board { margin-top: 16px; }
.thead, .row {
  display: grid; grid-template-columns: var(--cols); align-items: baseline;
}
.thead {
  font-size: 13px; color: var(--ink-2); line-height: 1.3;
  border-bottom: 1.5px solid var(--ink);
}
.thead > span { padding: 6px 6px 7px; }
.thead .h-group {
  grid-column: 6 / span 7; grid-row: 1;
  text-align: center; padding: 0 0 4px; margin: 0 2px;
  border-bottom: 1px solid var(--baseline); color: var(--ink);
}
.thead .h-no, .thead .h-title, .thead .h-artist, .thead .h-date, .thead .h-count, .thead .h-src, .thead .h-tog { grid-row: 2; }
.thead .h-src { text-align: center; border-left: 1px solid var(--grid); align-self: stretch; }
.thead .h-date, .thead .h-count { text-align: right; }
.thead .h-no { text-align: right; padding-right: 10px; }

.rows, .members { list-style: none; }
.entry { border-bottom: 1px solid var(--grid); }
.members .entry { border-bottom: 0; border-top: 1px dotted var(--baseline); }

.c-tt, .c-meta, .c-ranks { display: contents; }
.row > span, .c-tt > span, .c-meta > span, .c-ranks > span { padding: 10px 6px; min-width: 0; }
.row > .c-no {
  text-align: right; padding-right: 10px;
  font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 14px;
}
.members .c-no { color: var(--muted); font-size: 13.5px; }
.t-title { overflow-wrap: anywhere; }
.t-name { font-weight: 600; }
.album > summary .t-name { font-family: var(--serif); font-weight: 700; }
.members .t-name { font-weight: 500; }
.t-artist { color: var(--ink-2); overflow-wrap: anywhere; }
.m-date, .m-count { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 14.5px; }
.lbl-m { display: none; }
.lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.rk {
  text-align: center; border-left: 1px solid var(--grid); align-self: stretch;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rk .n { font-weight: 600; font-size: 16px; }
/* 一欄含多個榜時，名次下方小字標出來自哪個榜（如「台語新歌」），避免誤讀為總榜 */
.rk:not(.nil) { display: flex; flex-direction: column; align-items: center; }
.rk .nv { order: 1; }
.rk .cn { order: 2; font-size: 13px; line-height: 1.25; color: var(--ink-2); white-space: normal; padding-top: 1px; }
.rk.nil::after {
  content: ""; display: inline-block; width: 12px; height: 0;
  border-top: 1px solid var(--baseline); vertical-align: middle;
}
.chg { font-size: 13px; color: var(--ink-2); margin-left: 2px; }
.rk-none { display: none; }

.pick-mark {
  color: var(--accent); font-size: 13px; font-weight: 600; margin-right: 6px;
  letter-spacing: 0.06em; white-space: nowrap;
}
.pick-note { display: block; color: var(--ink-2); font-size: 14px; margin-top: 2px; font-weight: 400; }

summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary:hover .row { background: var(--surface); }
.c-tog { position: relative; }
.c-tog::before, .c-tog::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 9px; height: 0; border-top: 1.5px solid var(--ink-2);
  transform: translate(-50%, -50%);
}
.c-tog::after { transform: translate(-50%, -50%) rotate(90deg); }
details[open] > summary .c-tog::after { display: none; }

.detail { padding: 2px 0 14px calc(2.6rem + 6px); }
.charts { border-collapse: collapse; font-size: 13.5px; width: auto; max-width: 100%; }
.charts thead th { font-weight: 400; color: var(--muted); text-align: left; padding: 4px 18px 4px 0; border-bottom: 1px solid var(--grid); }
.charts th[scope="row"] { font-weight: 400; text-align: left; padding: 4px 18px 4px 0; color: var(--ink); }
.charts td { padding: 4px 18px 4px 0; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.charts td b { color: var(--ink); font-weight: 600; }
.charts tbody tr + tr > * { border-top: 1px solid var(--grid); }

.late .row > span, .late .c-tt > span, .late .c-meta > span, .late .c-ranks > span { padding-top: 7px; padding-bottom: 7px; }
.late .t-name { font-weight: 500; }

/* ——— 資料說明 ——— */
.notes p, .notes .rule, .notes dl { max-width: 44em; font-size: 14.5px; color: var(--ink-2); margin-top: 10px; }
.notes h3 { font-size: 14.5px; font-weight: 600; margin-top: 18px; }
.rule summary { color: var(--accent); }
.rule summary::before { content: "＋ "; }
.rule[open] summary::before { content: "－ "; }
.rule dl div, .cutoffs div {
  display: grid; grid-template-columns: 7em minmax(0, 1fr); gap: 12px;
  padding: 4px 0; border-bottom: 1px solid var(--grid);
}
.rule dt, .cutoffs dt { color: var(--ink); }
.notes .cutoffs { margin-top: 6px; max-width: 30em; }
.cutoffs dd { font-variant-numeric: tabular-nums; }

/* ——— 頁尾 ——— */
.colophon { margin-top: 56px; border-top: 4px double var(--ink); padding-top: 16px; font-size: 14px; color: var(--ink-2); }
.colophon .contact { font-size: 16px; margin-bottom: 14px; }
.colophon .contact a { font-weight: 600; }
.back-issues h2 { font-family: var(--serif); font-size: 17px; color: var(--ink); border: 0; padding: 0; }
.back-issues ol { list-style: none; margin: 6px 0 16px; }
.back-issues li { display: flex; gap: 14px; padding: 4px 0; border-bottom: 1px solid var(--grid); max-width: 28em; font-variant-numeric: tabular-nums; }
.credit { font-size: 13px; color: var(--muted); margin-top: 6px; max-width: 52em; }

/* ——— 窄螢幕：每首歌一個緊湊列區塊（仍是列，不是卡片） ——— */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .page { padding: 0 16px 48px; }
  .draft-bar { padding: 10px 16px; font-size: 14px; }
  .masthead { padding-top: 24px; }
  .thead { display: none; }
  .board { border-top: 1.5px solid var(--ink); margin-top: 12px; }

  .row {
    grid-template-columns: 2.2em minmax(0, 1fr) 1.4em;
    column-gap: 6px; padding: 10px 0;
  }
  .row > span, .c-tt > span, .c-meta > span, .c-ranks > span { padding: 0; }
  .row > .c-no { grid-column: 1; grid-row: 1 / span 3; padding-right: 4px; }
  .c-tt, .c-meta, .c-ranks { display: block; grid-column: 2; min-width: 0; }
  .c-tt { grid-row: 1; }
  .c-meta { grid-row: 2; margin-top: 2px; }
  .c-ranks { grid-row: 3; margin-top: 2px; }
  .c-tog { grid-column: 3; grid-row: 1; align-self: start; height: 1.6em; }

  .t-title { display: inline; margin-right: 0.6em; }
  .t-artist { display: inline; font-size: 14px; }
  .pick-note { font-size: 13.5px; }
  .m-date, .m-count { display: inline; font-size: 13.5px; }
  .m-count { margin-left: 1em; }
  .lbl-m { display: inline; }

  .c-ranks { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
  .rk, .rk:not(.nil) { display: inline; border: 0; white-space: nowrap; }
  .rk .cn { font-size: inherit; line-height: inherit; padding: 0; }
  .rk.nil { display: none; }
  .lbl { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .rk .n { font-size: 14px; color: var(--ink); }
  .rk:not(.nil):has(~ .rk:not(.nil))::after { content: "·"; margin-left: 0.45em; color: var(--muted); }
  .rk-none { display: inline; color: var(--muted); }

  .detail { padding: 0 0 12px 2.6em; }
  .charts { font-size: 13.5px; }
  .charts thead { display: none; }
  .charts th[scope="row"] { padding-right: 10px; white-space: normal; }
  .charts td { padding-right: 8px; }
  .charts td:nth-child(3) { display: none; }

  .lede p { font-size: 17px; }
  .rule dl div, .cutoffs div { grid-template-columns: 6.5em minmax(0, 1fr); }
  .credit { font-size: 13.5px; }
  .chg { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
