/* 大表頁：手機每一列是一張卡，寬螢幕是真表格。兩邊固定色：赭、梅 */
.at, .at-top { --ink: #1F252C; --ink-2: #4A535E; --line: #DCE1E6; --band: #F3F5F7; --bg: #fff;
  --a: #9D5D17; --a-soft: #FAECE0; --b: #905593; --b-soft: #F6EAF7; --n: #1F252C; --n-soft: #EEF1F4; }
.at-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--bg); }
.at-top-logo img { display: block; height: 32px; width: auto; }
.at-top-nav { display: flex; gap: 18px; font-size: 15px; font-weight: 700; }
.at-top-nav a { color: var(--ink); text-decoration: none; }
.at-top-nav a:hover, .at-top-nav a:focus-visible { text-decoration: underline; }

.at { max-width: 1120px; margin: 0 auto; padding: 28px 20px 64px; color: var(--ink); font-size: 17px; line-height: 1.65; }
.at a { color: inherit; }
.at-head { max-width: 760px; }
.at-kicker { font-size: 14px; font-weight: 700; color: var(--ink-2); margin: 0 0 8px; }
.at h1 { font-size: clamp(30px, 6.4vw, 52px); line-height: 1.2; font-weight: 900; margin: 0 0 16px; letter-spacing: 0; }
.at-concl { font-size: clamp(19px, 3.4vw, 23px); line-height: 1.55; font-weight: 700; margin: 0 0 16px; }
.at-disc { font-size: 15px; color: var(--ink-2); background: var(--band); padding: 12px 16px; border-radius: 8px; margin: 0; }

.at-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 28px 0 8px; }
.at-sum-i { padding: 18px 18px 16px 22px; background: var(--n-soft); border-radius: 10px; box-shadow: inset 6px 0 0 var(--n); }
.at-sum-i.a { background: var(--a-soft); box-shadow: inset 6px 0 0 var(--a); }
.at-sum-i.b { background: var(--b-soft); box-shadow: inset 6px 0 0 var(--b); }
.at-sum-v { font-size: 40px; line-height: 1.05; font-weight: 900; margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.at-sum-l { font-size: 16px; font-weight: 700; margin: 0; }
.at-sum-n { font-size: 14px; color: var(--ink-2); margin: 6px 0 0; }

.at-toc { margin: 24px 0 0; }
.at-toc ol { margin: 0; padding-left: 1.4em; font-size: 16px; }
.at-toc a { text-underline-offset: 3px; }
/* 搜尋整頁（有給 search 的頁才出現；手機上捲動時黏在頂端） */
.at-search { position: sticky; top: 0; z-index: 5; margin: 24px 0 0; padding: 12px 0; background: var(--bg); }
.at-search label { display: block; font-size: 14px; font-weight: 800; margin-bottom: 6px; }
.at-search input { width: 100%; box-sizing: border-box; font: inherit; font-size: 17px; min-height: 48px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink); }
.at-search input:focus-visible { outline: 3px solid var(--ink-2); outline-offset: 1px; }
.at-search-n { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); min-height: 1.4em; }
.at-tbl tr.at-nomatch, .at-sec.at-sec-nomatch { display: none !important; }   /* 手機卡片版 .at-tbl.compact tr 寫在後面會蓋掉，比照 [hidden] 用 !important */

.at-sec { margin-top: 56px; scroll-margin-top: 16px; }
.at-sec h2 { font-size: clamp(22px, 4.4vw, 30px); line-height: 1.3; font-weight: 900; margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.at-who { font-size: 15px; font-weight: 800; color: #fff; padding: 3px 10px; border-radius: 999px; background: var(--n); }
.at-who.a { background: var(--a); } .at-who.b { background: var(--b); }
.at-lead { margin: 0 0 14px; color: var(--ink-2); max-width: 760px; }

.at-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.at-filter-l { flex-basis: 100%; font-size: 14px; font-weight: 700; color: var(--ink-2); margin: 4px 0 -2px; }
.at-chip { font: inherit; font-size: 15px; font-weight: 700; padding: 8px 14px; min-height: 40px; border-radius: 999px; border: 2px solid var(--ink); background: var(--bg); color: var(--ink); cursor: pointer; }
.at-chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.at-chip:focus-visible, .at-sort:focus-visible { outline: 3px solid #02539C; outline-offset: 2px; }

.at-tbl { width: 100%; border-collapse: collapse; font-size: 16px; }
.at-tbl th, .at-tbl td { text-align: left; vertical-align: top; }
.at-sort { font: inherit; font-weight: 800; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.at-sort-i::after { content: "↕"; font-size: 13px; color: var(--ink-2); }
.at-sort[data-dir="asc"] .at-sort-i::after, .at-msort[data-dir="asc"] .at-sort-i::after { content: "↑"; color: inherit; }
.at-sort[data-dir="desc"] .at-sort-i::after, .at-msort[data-dir="desc"] .at-sort-i::after { content: "↓"; color: inherit; }
.at-msort[data-dir] { background: var(--ink); color: #fff; }
.at-msort .at-sort-i { margin-left: 4px; }

.at-st { justify-self: start; display: inline-block; font-weight: 800; font-size: 15px; padding: 2px 10px; border-radius: 6px; white-space: nowrap; }
.at-st.yes { background: var(--ink); color: #fff; }
.at-st.no { border: 2px solid var(--ink); padding: 0 8px; }
.at-st.part { background: var(--n-soft); }
.at-st.na { border: 2px dashed #8A939D; color: var(--ink-2); padding: 0 8px; }
.at-st.nf { color: var(--ink-2); font-weight: 700; padding: 2px 0; }
.at-empty { color: #8A939D; }
.at-src a { font-size: 14px; color: #02539C; text-underline-offset: 3px; word-break: break-word; }

.at-notes { margin: 14px 0 0; padding: 14px 18px 14px 34px; background: var(--band); border-radius: 8px; font-size: 15px; color: var(--ink-2); }
.at-notes li + li { margin-top: 6px; }

/* 手機：每一列一張卡；欄名從 data-label 帶出來 */
@media (max-width: 1179px) {
  .at-tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .at-tbl, .at-tbl tbody, .at-tbl tr, .at-tbl th, .at-tbl td { display: block; }
  .at-tbl tr { padding: 14px 16px; margin: 0 0 10px; border-radius: 10px; background: var(--band); box-shadow: inset 5px 0 0 var(--n); }
  .at-sec.a .at-tbl tr { box-shadow: inset 5px 0 0 var(--a); }
  .at-sec.b .at-tbl tr { box-shadow: inset 5px 0 0 var(--b); }
  .at-tbl th[scope="row"] { font-size: 18px; font-weight: 900; margin-bottom: 6px; }
  .at-tbl td { display: grid; grid-template-columns: 5.5em 1fr; gap: 8px; padding: 3px 0; }
  .at-tbl td::before { content: attr(data-label); font-size: 14px; font-weight: 700; color: var(--ink-2); padding-top: 1px; }
  .at-tbl td:has(> .at-empty) { display: none; }
  .at-sort-bar { display: flex; gap: 8px; margin: 0 0 12px; }
  /* 列多的表（compact）：一列一行——第一欄、狀態、其他欄、出處排在同一行，備註（wide）另起一行 */
  .at-tbl.compact tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 14px; margin-bottom: 6px; }
  .at-tbl.compact th[scope="row"] { font-size: 17px; margin: 0; min-width: 3.2em; }
  .at-tbl.compact td { display: block; padding: 0; }
  .at-tbl.compact td::before { content: none; }
  .at-tbl.compact td.wide { flex-basis: 100%; font-size: 15px; color: var(--ink-2); }
  .at-tbl.compact td.at-src { margin-left: auto; }
  .at-tbl.compact td:has(> .at-empty) { display: none; }
  /* 狀態格前面帶欄名（「發言 沒有」「簽到 列席」），不然一排標籤分不出是哪一欄 */
  .at-tbl.compact td:has(> .at-st) { display: inline-flex; align-items: center; gap: 6px; }
  .at-tbl.compact td:has(> .at-st)::before { content: attr(data-label); font-size: 13px; font-weight: 700; color: var(--ink-2); }
}
/* 跳到主要內容：平常藏起來，鍵盤聚焦才出現 */
.skip-link { position: absolute; left: -9999px; top: 0; }
.skip-link:focus { left: 12px; top: 12px; z-index: 10; background: #fff; padding: 8px 12px; }
/* 寬螢幕：真表格，表頭貼頂 */
@media (min-width: 1180px) {
  .at-sort-bar { display: none; }
  .at-wrap { border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
  .at-tbl thead th { position: sticky; top: 0; background: var(--band); font-size: 15px; font-weight: 800; padding: 12px 14px; border-bottom: 2px solid var(--line); z-index: 1; }
  .at-tbl tbody th, .at-tbl tbody td { padding: 12px 14px; border-top: 1px solid var(--line); }
  .at-tbl tbody th { font-weight: 800; min-width: 4em; }
  .at-tbl .wide { min-width: 11em; }
  .at-tbl thead th { white-space: nowrap; }
  .at-tbl tbody td:not(.wide) { min-width: 4.5em; }
  .at-tbl tbody tr:hover { background: #FAFBFC; }
}

.at-foot { margin-top: 72px; padding-top: 32px; border-top: 2px solid var(--ink); display: grid; gap: 28px; max-width: 760px; font-size: 16px; }
.at-foot h2 { font-size: 19px; font-weight: 900; margin: 0 0 8px; }
.at-foot ul { margin: 0; padding-left: 1.3em; } .at-foot li + li { margin-top: 6px; }
.at-foot p { margin: 0; }
.at-foot a { color: #02539C; word-break: break-word; }

.at-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.at-list a { display: grid; gap: 4px; padding: 18px 20px; background: var(--band); border-radius: 10px; text-decoration: none; }
.at-list-d { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.at-list-t { font-size: 20px; font-weight: 900; }
.at-list-c { font-size: 16px; color: var(--ink-2); }

[hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) { .at-tbl tr { transition: background .15s; } }
.at-bal { font-size: 16px; line-height: 1.6; margin: 0 0 16px; padding-left: 14px; box-shadow: inset 4px 0 0 var(--ink); }
/* 折線圖：分段底色兩階中性灰；線與點用墨色；格線 1px 淡灰 */
.at-fig { position: relative; margin: 8px 0 0; }
.at-line { display: block; width: 100%; height: auto; font-family: inherit; }
.at-band.b0 { fill: #EEF1F4; } .at-band.b1 { fill: #E2E6EA; }
.at-band-l { font-size: 18px; font-weight: 800; fill: var(--ink-2); }
.at-grid { stroke: #D3D9DF; stroke-width: 1; }
.at-ax { font-size: 17px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.at-path { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.at-dot { fill: var(--ink); stroke: #fff; stroke-width: 2; cursor: pointer; }
.at-dot:hover, .at-dot:focus { r: 8; outline: none; }
.at-end { font-size: 20px; font-weight: 900; fill: var(--ink); }
.at-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 14px; line-height: 1.45; padding: 8px 10px; border-radius: 6px; transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; }
.at-tip b { font-size: 16px; }
.at-data { margin-top: 12px; }
.at-data summary { cursor: pointer; font-weight: 800; font-size: 16px; padding: 8px 0; color: #02539C; }
.at-data .at-wrap { margin-top: 8px; }
/* 折線圖寬窄兩版：手機看直一點的那張，字放大 */
.at-line.narrow { display: none; }
@media (max-width: 759px) {
  .at-line.wide { display: none; }
  .at-line.narrow { display: block; }
  .at-line.narrow .at-ax { font-size: 23px; }
  .at-line.narrow .at-band-l { font-size: 23px; }
  .at-line.narrow .at-end { font-size: 28px; }
  .at-line.narrow .at-dot { stroke-width: 2.5; }
}
/* 展開列（每列底下「點開看」）：跟上面那列連成一塊；裡面一項一行 */
.at-det summary { cursor: pointer; font-weight: 800; font-size: 15px; color: #02539C; padding: 6px 0; min-height: 32px; text-underline-offset: 3px; }
.at-det summary:hover { text-decoration: underline; }
.at-det summary:focus-visible { outline: 3px solid #02539C; outline-offset: 2px; }
.at-det-l { list-style: none; margin: 6px 0 4px; padding: 0; font-size: 15px; }
.at-det-l li { display: flex; flex-wrap: wrap; gap: 2px 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.at-det-l li > span:first-child { font-weight: 800; font-variant-numeric: tabular-nums; }
.at-det-l a { color: #02539C; font-size: 14px; text-underline-offset: 3px; }
.at-det-n { margin: 6px 0 4px; padding-left: 1.2em; font-size: 14px; color: var(--ink-2); }
.at-det-n li + li { margin-top: 4px; }
@media (max-width: 1179px) {
  .at-tbl tr.at-det td { display: block; padding: 0; }
  .at-tbl tr.at-det td::before { content: none; }
  /* 列多的表（compact）平常不帶欄名；欄位標了 label 的（例：勝率、輸幾場這種光看數字分不出是哪欄）照樣帶 */
  .at-tbl.compact td.at-lbl { display: inline-flex; align-items: baseline; gap: 6px; }
  .at-tbl.compact td.at-lbl::before { content: attr(data-label); font-size: 13px; font-weight: 700; color: var(--ink-2); }
  .at-tbl.compact td.at-lbl:has(> .at-empty) { display: none; }
  .at-tbl tr:has(+ tr.at-det) { margin-bottom: 0; border-radius: 10px 10px 0 0; }
  .at-tbl tr.at-det, .at-tbl.compact tr.at-det { display: block; margin: 0 0 10px; padding: 0 14px 8px; border-radius: 0 0 10px 10px; }
  .at-tbl.compact tr.at-det td { padding: 0; }
}
@media (min-width: 1180px) {
  .at-tbl tbody tr:has(+ tr.at-det) > * { border-bottom: 0; }
  .at-tbl tbody tr.at-det td { padding: 0 14px 10px; border-top: 0; }
  .at-det-l li { display: grid; grid-template-columns: 3.4em minmax(12em, 2fr) minmax(8em, 1.3fr) minmax(7em, 1fr) minmax(9em, 1fr) minmax(7em, 1.4fr) 4em; gap: 12px; align-items: baseline; }
}
