/* WK 短網址（2026-11-28）
   設計判讀：一個人自己用的工具頁，手機為主（多半在 LINE、Chrome 裡開），信任與速度優先；
   原生 CSS＋範本 style.css 的 WeKen 黃當唯一強調色，Geist／Noto Sans TC。
   Dials：VARIANCE 3／MOTION 2／DENSITY 5。數字用 Dan Roam：有多少＝數字磚與長條、什麼時候＝每日長條、從哪來＝橫條排名 */

.h1 { font-size: 22px; }
.card.pad { padding: 18px 16px; display: grid; gap: 14px; }
.sec-t { font-size: 15px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* 建立 */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pill span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: 15px; font-weight: 500; color: var(--ink-2); }
.pill input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); font-weight: 600; }
.pill input:focus-visible + span { outline: 3px solid #1F2937; outline-offset: 2px; }
.prefix { display: flex; align-items: stretch; border: 1.5px solid #CFCFC8; border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.prefix span { display: flex; align-items: center; padding: 0 4px 0 12px; color: var(--ink-3); font-size: 15px; white-space: nowrap; }
.field .prefix input { border: 0; min-width: 0; padding-left: 2px; }
.prefix:focus-within { outline: 3px solid #1F2937; outline-offset: 2px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: #1C1C21; flex: none; }
.more summary { cursor: pointer; font-size: 15px; color: var(--ink-2); min-height: 40px; display: flex; align-items: center; gap: 6px; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary .ic { transition: transform .15s; }
.more[open] summary .ic { transform: rotate(90deg); }
.more .group { padding-top: 6px; }

/* 剛建好的 */
.made { border: 2px solid var(--accent); }
.short { font-family: "Geist", var(--font); font-size: 19px; font-weight: 600; word-break: break-all; letter-spacing: 0; }
.short small { color: var(--ink-3); font-weight: 500; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.made-qr { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.qr { background: #fff; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line); line-height: 0; }
.qr svg { width: 100%; height: auto; display: block; }

/* 數字磚 */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
.tile b { font-family: "Geist", var(--font); font-size: 26px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile span { font-size: 13px; color: var(--ink-3); }
.tile.sm b { font-size: 17px; }

/* 清單：一條一行 */
.list { display: grid; }
.li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 4px; text-decoration: none; color: var(--ink); border-top: 1px solid var(--line); min-height: 64px; }
.li:first-child { border-top: 0; }
.li:active { background: #F6F6F2; }
.li .code { font-family: "Geist", var(--font); font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.li .t { grid-column: 1; font-size: 14px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.li .n { grid-row: 1 / span 2; grid-column: 2; text-align: right; display: grid; }
.li .n b { font-family: "Geist", var(--font); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.li .n span { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.li.off { opacity: .72; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: #F0F0EC; color: var(--ink-2); font-size: 12px; font-weight: 600; font-family: var(--font); white-space: nowrap; }
.tag.off { background: var(--danger-soft); color: var(--danger); }
.search input { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r-sm); border: 1.5px solid #CFCFC8; font-size: 16px; background: var(--surface); }
.empty { text-align: center; color: var(--ink-3); padding: 22px 8px; display: grid; gap: 6px; justify-items: center; }

/* 期間切換 */
.seg { display: inline-flex; background: #ECECE7; border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; min-height: 36px; padding: 0 12px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

/* 每天幾次：長條 */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding-top: 6px; }
.bars i { flex: 1; background: var(--accent); border-radius: 0; min-height: 2px; position: relative; }
.bars i.z { background: #E6E6E1; }
.bars-x { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* 排名橫條（從哪來、國家、管道） */
.rank { display: grid; gap: 10px; }
.rk { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 15px; }
.rk .bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--accent); }
.rk b { font-variant-numeric: tabular-nums; font-weight: 600; }
.rk span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk small { color: var(--ink-3); font-size: 13px; font-weight: 400; }

/* 手機／電腦：一條比例條 */
.bar-split { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: #ECECE7; }
.bar-split i:nth-child(1) { background: var(--accent); }
.bar-split i:nth-child(2) { background: #1C1C21; }
.bar-split i:nth-child(3) { background: #9A9AA0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend span::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

/* 單一連結 */
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); text-decoration: none; font-size: 15px; min-height: 40px; }
.dest { font-size: 14px; color: var(--ink-3); word-break: break-all; }
.dest a { color: var(--ink-2); }
.qr-card { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; }
.note { font-size: 13.5px; color: var(--ink-3); line-height: 1.6; }

/* 分享預覽長什麼樣（模擬 LINE 裡的卡片） */
.pv { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: #fff; max-width: 320px; }
.pv .img { aspect-ratio: 1200 / 630; background: #ECECE7 center / cover no-repeat; display: grid; place-items: center; color: var(--ink-3); font-size: 13px; }
.pv .tx { padding: 10px 12px; display: grid; gap: 2px; }
.pv .tx b { font-size: 15px; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pv .tx span { font-size: 13px; color: var(--ink-3); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pv .tx small { font-size: 12px; color: var(--ink-3); }

@media (max-width: 374px) {
  .tiles { gap: 8px; }
  .tile { padding: 10px; }
  .tile b { font-size: 22px; }
  .qr-card { grid-template-columns: 110px 1fr; }
  .made-qr { grid-template-columns: 80px 1fr; }
}

/* 標題跟期間切換放不下時，切換換到下一行（不把按鈕字擠成直的） */
.sec-t { flex-wrap: wrap; row-gap: 8px; }
.seg button { white-space: nowrap; }
details.card.pad { display: block; }
details.card.pad > summary { min-height: 44px; }

/* 主欄一律 minmax(0,1fr)：裡面任何一塊的最小寬度都不能把整欄撐出畫面（320 寬時右邊只剩 2px） */
main { grid-template-columns: minmax(0, 1fr); }

/* 貼在哪裡：8 顆排成兩排 4 顆，不會有單獨掉到下一排的（2026-11-28 挑錯者 B、C 都抓到「其他」單獨一排） */
.pills[role=radiogroup] { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pills[role=radiogroup] .pill span { width: 100%; justify-content: center; padding: 0 4px; font-size: 14.5px; }
.row2 .btn { padding-inline: 12px; min-width: 0; }
#sum { display: grid; gap: 10px; }
.li .code { flex-wrap: wrap; row-gap: 2px; }
.li .code .cd { white-space: nowrap; }
/* 只有幾根的時候長條不要撐滿整張圖（一天一次會變成一整塊黃，像壞掉；2026-11-28 挑錯者 C） */
.bars i { max-width: 28px; }
.bars { justify-content: center; }
