/* 探索頁：每日懶人包、詐騙查詢、案件地圖 */

.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.active .n { color: rgba(255, 255, 255, .85); }

/* ── 每日懶人包 ── */
.digest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.digest-card { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 16px; color: var(--text); text-decoration: none; transition: border-color .15s, background .15s; }
.digest-card:hover { border-color: var(--brand); background: var(--surface-2); color: var(--text); }
.digest-date { flex: 0 0 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 72px; border-radius: 14px; background: var(--brand-soft); color: var(--brand-soft-text); line-height: 1.1; }
.digest-date .m { font-size: .72rem; font-weight: 700; }
.digest-date .d { font-size: 1.5rem; font-weight: 900; }
.digest-date .w { font-size: .7rem; }
.digest-body { min-width: 0; }
.digest-body h2 { line-height: 1.5; }
.digest-items { list-style: none; margin: 0; padding: 0; }
.digest-item { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-top: 1px solid var(--line); }
.digest-item:first-child { border-top: 0; padding-top: 0; }
.digest-num { flex: 0 0 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-grad); color: #fff; font-weight: 900; }
.digest-item-body { flex: 1 1 auto; min-width: 0; }
.digest-item-body .post-title { color: var(--text); font-weight: 800; text-decoration: none; line-height: 1.5; }
.digest-item-body .post-title:hover { color: var(--brand-soft-text); }
.digest-thumb { flex: 0 0 160px; }
.digest-thumb img { width: 160px; height: 84px; object-fit: cover; border-radius: 12px; display: block; }
@media (max-width: 575.98px) {
  .digest-thumb { flex-basis: 96px; }
  .digest-thumb img { width: 96px; height: 60px; }
  .digest-date { flex-basis: 54px; height: 64px; }
}

/* ── 詐騙查詢 ── */
.scam-search { position: relative; display: flex; gap: 8px; }
.scam-search > .bi { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 1.1rem; pointer-events: none; }
.scam-search .form-control { padding-left: 44px; border-radius: 999px; min-width: 0; }
.scam-search .btn { border-radius: 999px; flex: 0 0 auto; }
@media (max-width: 575.98px) {
  .scam-search { flex-direction: column; }
  .scam-search > .bi { top: 24px; }
}
.scam-result { border-radius: 16px; padding: 16px 18px; border: 1px solid var(--line-strong); background: var(--surface-2); }
.scam-result.is-danger { border-color: rgba(220, 38, 38, .45); background: rgba(220, 38, 38, .08); }
.scam-result.is-clear { border-color: rgba(37, 99, 235, .35); background: rgba(37, 99, 235, .06); }
.scam-result-head { display: flex; gap: 12px; align-items: flex-start; }
.scam-result-head > .bi { font-size: 1.6rem; line-height: 1; }
.scam-result.is-danger .scam-result-head > .bi { color: #dc2626; }
.scam-result.is-clear .scam-result-head > .bi { color: #2563eb; }
.scam-result-head strong { display: block; font-size: 1.05rem; margin-bottom: 2px; }
.scam-result-head span { display: block; font-size: .9rem; color: var(--text-2); }
.scam-matches { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.scam-matches li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 8px 12px; border-radius: 10px; background: var(--surface); font-size: .86rem; color: var(--text-2); }
.scam-matches code, .scam-latest code { color: #dc2626; font-weight: 700; word-break: break-all; }
.scam-steps { padding-left: 1.2rem; line-height: 1.9; }
.scam-term { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; font-size: .88rem; }
.scam-term span { color: var(--text-2); font-size: .82rem; }
.scam-term:hover { border-color: var(--brand); color: var(--text); }
.scam-latest { list-style: none; margin: 0; padding: 0; font-size: .82rem; }
.scam-latest li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px dashed var(--line); }
.scam-latest li:first-child { border-top: 0; }
.scam-latest span { color: var(--text-3); text-align: right; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 案件地圖（縣市磚塊） ── */
.map-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tile-map { display: grid; grid-template-columns: repeat(5, minmax(0, 72px)); grid-auto-rows: 64px; gap: 6px; width: 100%; max-width: 400px; justify-content: center; }
.map-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; text-decoration: none; color: var(--text);
  background: var(--surface-2); border: 2px solid transparent; transition: transform .12s, border-color .12s; line-height: 1.2; }
.map-tile:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--text); }
.map-tile.active { border-color: var(--text); box-shadow: 0 0 0 3px var(--brand-soft); }
.map-tile.island { border-style: dashed; border-color: var(--line-strong); }
.map-tile .name { font-weight: 800; font-size: .92rem; white-space: nowrap; letter-spacing: -.02em; }
.map-tile .n { font-size: .78rem; opacity: .85; }
.lv-1 { background: #ffe4ea; }
.lv-2 { background: #fecdd3; }
.lv-3 { background: #fda4af; }
.lv-4 { background: #fb7185; color: #fff; }
.lv-5 { background: #e11d48; color: #fff; }
.map-tile.lv-4, .map-tile.lv-5 { color: #fff; }
[data-bs-theme="dark"] .lv-1 { background: #4c1d2a; }
[data-bs-theme="dark"] .lv-2 { background: #6b2136; }
[data-bs-theme="dark"] .lv-3 { background: #9f1239; color: #fff; }
[data-bs-theme="dark"] .map-tile.lv-3 { color: #fff; }
.map-legend { display: flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--text-3); }
.map-legend i { width: 22px; height: 10px; border-radius: 3px; display: inline-block; }
@media (max-width: 575.98px) {
  .tile-map { grid-auto-rows: 56px; gap: 4px; }
  .map-tile .name { font-size: .84rem; }
}
.map-rank { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.map-rank li a { display: grid; grid-template-columns: 4.5em 1fr auto; align-items: center; gap: 8px; padding: 5px 0; color: var(--text); text-decoration: none; font-size: .86rem; }
.map-rank .bar { height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--brand) var(--w), var(--surface-2) var(--w)); }
.map-rank b { font-size: .8rem; color: var(--text-2); }

/* ── 縣市專頁 ── */
.city-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.city-card { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); text-decoration: none; transition: border-color .15s, background .15s; }
.city-card:hover { border-color: var(--brand); background: var(--surface-2); color: var(--text); }
.city-card .name { font-weight: 800; }
.city-card .n { font-size: .85rem; color: var(--text-2); }
.city-card .n b { color: var(--brand-soft-text); font-size: 1.05rem; }
.city-card .top { font-size: .75rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat-box { padding: 10px 12px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.stat-box b { display: block; font-size: 1.4rem; font-weight: 900; line-height: 1.2; }
.stat-box span { font-size: .78rem; color: var(--text-2); }
@media (max-width: 575.98px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .city-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.city-cats li a { grid-template-columns: 7.5em 1fr auto; }
.city-cats li a[aria-current] span:first-child { font-weight: 800; color: var(--brand-soft-text); }
.city-cats li a:hover span:first-child { color: var(--brand-soft-text); }

/* 側欄編號小列表 */
.mini-list.ranked { counter-reset: r; }
.mini-list.ranked li { position: relative; padding-left: 30px; counter-increment: r; }
.mini-list.ranked li::before { content: counter(r); position: absolute; left: 0; top: 12px; width: 22px; text-align: center; font-weight: 900; color: var(--text-3); }
.mini-list.ranked li:first-child::before { top: 0; }
.mini-list.ranked li:nth-child(-n+3)::before { color: var(--brand); }


/* ── 防詐與法律專題 ── */
.guide-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.guide-card { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; color: var(--text); text-decoration: none; transition: border-color .15s, background .15s; }
.guide-card:hover { border-color: var(--brand); background: var(--surface-2); color: var(--text); }
.guide-card h3 { line-height: 1.5; font-weight: 800; }
.guide-card p { margin: 0; font-size: .86rem; color: var(--text-2); line-height: 1.6; }
.guide-card .m { margin-top: auto; font-size: .76rem; color: var(--text-3); }
@media (max-width: 575.98px) { .guide-list { grid-template-columns: minmax(0, 1fr); } }
.guide-lead { font-size: 1.02rem; line-height: 1.9; color: var(--text-2); padding: 12px 16px; border-left: 4px solid var(--brand); background: var(--surface-2); border-radius: 0 12px 12px 0; }
.faq-list { display: grid; gap: 8px; }
.faq-list details { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; background: var(--surface); }
.faq-list details[open] { background: var(--surface-2); }
.faq-list summary { cursor: pointer; font-weight: 700; line-height: 1.6; list-style: none; display: flex; gap: 8px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::before { content: "Q"; flex: 0 0 auto; color: var(--brand); font-weight: 900; }
.faq-list details p { margin: 8px 0 0; line-height: 1.85; color: var(--text-2); }
.law-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.law-chips a { display: inline-block; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: .82rem; color: var(--text-2); text-decoration: none; }
.law-chips a:hover { border-color: var(--brand); color: var(--brand-soft-text); }

/* ── 系列專題時間軸 ── */
.story-timeline { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; }
.story-timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line-strong); border-radius: 2px; }
.story-timeline li { position: relative; padding: 0 0 20px; }
.story-timeline li:last-child { padding-bottom: 0; }
.story-timeline li::before { content: ""; position: absolute; left: -22px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); }
.story-timeline li:last-child::before { background: var(--brand); }
.story-timeline .when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-3); margin-bottom: 4px; }
.story-timeline .post-title { color: var(--text); font-weight: 800; text-decoration: none; line-height: 1.5; }
.story-timeline .post-title:hover { color: var(--brand-soft-text); }

/* ── 編輯團隊 ── */
.editor-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.editor-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; color: var(--text); text-decoration: none; height: 100%; }
.editor-card:hover { border-color: var(--brand); background: var(--surface-2); color: var(--text); }
.editor-card img { border-radius: 50%; flex: 0 0 56px; object-fit: cover; }
.editor-card > div { min-width: 0; }
.editor-head { display: flex; gap: 18px; align-items: center; }
.editor-head img { border-radius: 50%; flex: 0 0 88px; object-fit: cover; }
@media (max-width: 575.98px) {
  .editor-list { grid-template-columns: minmax(0, 1fr); }
  .editor-head { gap: 12px; }
  .editor-head img { width: 64px; height: 64px; flex-basis: 64px; }
}

/* ── 更正紀錄 ── */
.correction-list { list-style: none; margin: 0; padding: 0; }
.correction-list li { padding: 14px 0; border-top: 1px solid var(--line); }
.correction-list li:first-child { border-top: 0; padding-top: 0; }
.correction-list .when { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-3); margin-bottom: 4px; }
.correction-list .post-title { color: var(--text); font-weight: 800; text-decoration: none; }
.correction-list .post-title:hover { color: var(--brand-soft-text); }
.scam-result.is-warning { border-color: rgba(234, 88, 12, .45); background: rgba(234, 88, 12, .08); }
.scam-result.is-warning .scam-result-head > .bi { color: #ea580c; }

/* ── 判決統計 ── */
.sent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sent-row { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); text-decoration: none; }
.sent-row:hover { border-color: var(--brand); background: var(--surface-2); color: var(--text); }
.sent-row .head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.sent-row .head span { color: var(--text-3); font-size: .85rem; }
.sent-row .meta { font-size: .82rem; color: var(--text-2); margin-top: 4px; }
.sent-bar { position: relative; height: 10px; border-radius: 999px; background: var(--surface-2); margin: 4px 0; }
.sent-bar .range { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: rgba(124, 58, 237, .28); }
.sent-bar .median { position: absolute; top: -3px; width: 4px; height: 16px; margin-left: -2px; border-radius: 2px; background: #7c3aed; }
