/* 晴晞法律事務所｜法律工具箱｜司法機關地圖：左欄樣式（律師 115.11.14 定稿之第 7 版：指引牌左欄、金線箭頭、晞光層次機關卡；字體全黑體）。
   本檔接在 map.css 之後載入，覆寫 map.css 的基礎樣式。
   動效只動 transform、opacity；滑過的變色不加轉場；位移類滑過效果只在有滑鼠的裝置。減少動態時由 map.css 全數關閉。
   深底牌面用本檔自訂的 --p-* 色，不用 --navy／--on-navy（那兩個在深色外觀會翻成金底）。 */
:root{--p-plate:#1c3545;--p-plate2:#254857;--p-on:#f8f5ef;--p-on-m:#c3cfd5;--p-au:#e0c789;--p-mm-off:#3d6074;--p-mm-on:#e0c789}
:root[data-theme="dark"]{--p-plate:#0d1b24;--p-plate2:#1d3443;--p-mm-off:#31505f}

/* 共用：圖示預設不顯示，用到的地方自行打開 */
.ic,.mm{display:none}
.ic{flex:none;width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.mm{flex:none;background:var(--p-plate)}
.mm-c{fill:var(--p-mm-off)}.mm-c.is-on{fill:var(--p-mm-on)}.mm-r{fill:none;stroke:var(--p-mm-on);stroke-width:520px}

/* 結果區最後的「回上一步」（鍵盤往後 Tab 到得了；手機看完長卡片也不用捲回去） */
.cm-prev{display:inline-flex;align-items:center;gap:10px;min-height:48px;margin-top:6px;font-size:16px;color:var(--muted)}
.cm-prev::before{content:"";width:7px;height:7px;border-left:1.5px solid var(--gold-d);border-bottom:1.5px solid var(--gold-d);transform:rotate(45deg)}
.cm-prev:hover{color:var(--ink)}
.cat b,.reg b{white-space:nowrap}


@keyframes p-in{0%{opacity:0;transform:translateY(10px)}100%{opacity:1;transform:none}}
@keyframes p-in-x{0%{opacity:0;transform:translateX(-14px)}100%{opacity:1;transform:none}}
@keyframes p-in-up{0%{opacity:0;transform:translateY(22px)}100%{opacity:1;transform:none}}
@keyframes p-fade{0%{opacity:0}100%{opacity:1}}
@keyframes p-beat{0%{transform:scale(1)}28%{transform:scale(1.03)}50%{transform:scale(.995)}72%{transform:scale(1.015)}100%{transform:scale(1)}}
@keyframes p-beat-l{0%{transform:scale(1)}26%{transform:scale(1.4)}50%{transform:scale(1)}74%{transform:scale(1.2)}100%{transform:scale(1)}}
@keyframes p-drawx{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}
@keyframes p-drawy{0%{transform:scaleY(0)}100%{transform:scaleY(1)}}
@keyframes p-sun{0%{transform:translateY(100%)}60%{transform:translateY(-8%)}100%{transform:translateY(0)}}
@keyframes p-shoot{0%{transform:none;opacity:1}100%{transform:translateX(16px);opacity:0}}

/* 共用：下一步的選項依序進場（只在步驟真的變了的時候播一次）；被點的那一格跳一下 */
:root .is-enter .cat,:root .is-enter .reg,:root .is-enter .names li,:root .is-enter .seg,:root .is-enter .cty{animation:p-in .36s ease-out both}
:root .is-enter .cat:nth-child(2),:root .is-enter .reg:nth-child(2),:root .is-enter li:nth-child(2){animation-delay:.04s}
:root .is-enter .cat:nth-child(3),:root .is-enter .reg:nth-child(3),:root .is-enter li:nth-child(3){animation-delay:.08s}
:root .is-enter .cat-s,:root .is-enter .reg:nth-child(4),:root .is-enter li:nth-child(4){animation-delay:.12s}
:root .is-enter .reg:nth-child(5),:root .is-enter li:nth-child(5){animation-delay:.16s}
:root .is-enter .reg:nth-child(6),:root .is-enter li:nth-child(6){animation-delay:.2s}
:root .is-enter li:nth-child(n+7){animation-delay:.24s}
:root .cm-pick .is-hit.is-hit{animation:p-beat .2s ease-out both}
:root .cat:active,:root .reg:active,:root .names button:active{transform:scale(.985)}

/* ═════ 第 7 版（律師 115.11.14 選定的混搭）：類別與各選項頁＝指引牌的深藍看板與掛牌，箭頭與按下回應＝金線落定（細金箭頭、金線畫滿底邊）；
   機關卡＝晞光層次（名牌上的日出、地址時間軸）。 ═════ */
.as{white-space:nowrap}
.as2{display:inline-block;max-width:100%;vertical-align:top}
:root .cm-desk{--bg2:#254857;--ink:#f8f5ef;--text:#e6ecee;--muted:#c3cfd5;--gold:#d8bf80;--gold-d:#e0c789;--gold-soft:#33565f;--line:#48687a;--navy:#e0c789;--on-navy:#1c3545;--focus:#f3e0a8;--p4-box:#11242f;--p7-hd:#254857;background:#1c3545;color:var(--text)}
:root[data-theme="dark"] .cm-desk{--bg2:#1b3342;--line:#3a5463;--gold-soft:#22363a;--p4-box:#091419;--p7-hd:#0b171e;background:#0f1f29}
:root .flt::placeholder{color:var(--muted);opacity:1}
/* 掛牌：圖示框｜名稱｜細金箭頭；金線由左畫滿底邊 */
:root .cats,:root .regs{grid-template-columns:minmax(0,1fr);gap:8px}
:root .cat,:root .reg{position:relative;display:grid;align-items:center;border:0;padding:0 46px 0 0}
:root .cat{grid-template-columns:72px minmax(0,1fr);grid-template-rows:1fr auto auto 1fr;column-gap:18px;min-height:88px}
:root .cat>.ic:first-child{display:block;grid-row:1/5;align-self:stretch;width:72px;height:auto;min-height:88px;padding:0 20px;background:var(--p4-box);color:var(--gold-d);border-right:3px solid var(--gold)}
:root .cat b{grid-column:2;grid-row:2;font-size:30px}
:root .cat span{grid-column:2;grid-row:3}
:root .cat-s{width:100%;min-height:64px;margin-top:8px;grid-template-rows:1fr auto 1fr;grid-template-columns:72px auto minmax(0,1fr)}
:root .cat-s>.ic:first-child{grid-row:1/4;min-height:64px;padding:0 22px}
:root .cat-s b{grid-row:2;font-size:20px}
:root .cat-s span{grid-column:3;grid-row:2}
:root .reg{grid-template-columns:56px 4.2em minmax(0,1fr);column-gap:14px;min-height:72px}
:root .reg .mm{display:block;align-self:stretch;width:56px;height:100%;min-height:72px;padding:6px 5px;background:var(--p4-box);border-right:3px solid var(--gold)}
:root .cat::after,:root .reg::after,:root .names button::after{content:"";position:absolute;right:22px;top:50%;width:10px;height:10px;margin-top:-5px;border-top:2px solid var(--gold-d);border-right:2px solid var(--gold-d);transform:rotate(45deg)}
:root .cat::before,:root .reg::before{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;background:var(--gold);transform:scaleX(0);transform-origin:left;transition:transform .28s ease-out}
:root .cat.is-hit::before,:root .reg.is-hit::before{transform:scaleX(1);transition-duration:.16s}
:root .cat:hover,:root .reg:hover{transform:none}
:root .is-enter .cat,:root .is-enter .reg,:root .is-enter .names li{animation-name:p-in-x}
/* 分組頁籤 */
:root .seg{gap:6px;border:0}
:root .seg button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:76px;border:0;background:var(--bg2);color:var(--text)}
:root .seg button::after{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;background:var(--gold)}
:root .seg .ic{display:block;width:26px;height:26px;color:var(--gold-d)}
:root .seg .is-on{background:var(--navy);color:var(--on-navy)}
:root .seg .is-on .ic{color:var(--on-navy)}
:root .seg .is-on::after{height:5px;background:var(--on-navy);transform-origin:left;animation:p-drawx .34s ease-out both}
/* 機關清單：看板上的列，左側金點按下時拉成金條 */
:root .grp{margin:18px 0 0;padding-bottom:6px;border-bottom:2px solid var(--gold)}
:root .names{gap:0}
:root .names button{position:relative;min-height:58px;padding:6px 44px 6px 24px;border:0;border-bottom:1px solid var(--line);background:none}
:root .names button::after{right:14px;width:8px;height:8px;margin-top:-4px;border-width:1.5px}
:root .names button::before{content:"";position:absolute;left:6px;top:50%;width:7px;height:7px;margin-top:-4px;background:var(--gold);transition:transform .22s ease-out}
:root .names button.is-hit::before{transform:scaleY(7);transition-duration:.14s}
:root .names button:hover{transform:none;background:var(--bg2)}
:root .cm-pick .names .is-hit.is-hit{animation:none}
:root .cty button,:root .opts button{border:0;border-bottom:2px solid var(--gold)}
:root .cty button:hover,:root .opts button:hover{background:var(--gold-soft)}
:root .cm-path{position:relative}
:root .cm-path .is-cur{position:relative}
:root .cm-path .is-cur::after{content:"";position:absolute;left:4px;right:4px;bottom:9px;height:2px;background:var(--gold);transform-origin:left}
:root .cm-path.is-enter .is-cur::after{animation:p-drawx .4s .1s ease-out both}
/* 機關卡：金邊下掛一塊名牌（與掛牌同色，上有日出），名牌下是一張米白的地址單 */
:root .main{padding:0 0 10px;border:0;border-top:6px solid #d8bf80}
:root:not([data-theme="dark"]) .main{--bg2:#fffdf8;--ink:#1c3545;--text:#213e50;--muted:#536775;--gold:#b79544;--gold-d:#7a5f1c;--gold-soft:#efe4c4;--line:#d9d4c3;--navy:#254857;--on-navy:#f8f5ef;--focus:#96681f;color:var(--text)}
:root .hd{position:relative;overflow:hidden;padding:18px 96px 20px 20px;background:var(--p7-hd)}
:root .hd .kind{color:var(--p-au)}
:root .hd h2{color:var(--p-on)}
:root .hd::after{content:"";position:absolute;right:22px;bottom:-32px;width:64px;height:64px;border-radius:50%;background:var(--p-au)}
:root .is-enter .hd::after{animation:p-sun .7s .15s ease-out both}
:root .scope,:root .addr,:root .acts,:root .links{margin-left:20px;margin-right:20px}
:root .scope,:root .addr{margin-top:14px}
:root .acts .solid{gap:8px}
:root .acts .ic{display:block;width:20px;height:20px}
/* 各處地址表：每一處固定兩層。第一層名稱在左、總機在右（各列總機上下對齊）；第二層地址佔滿整列，只在語意斷點折行 */
:root .places{margin:6px 14px 0;border-top:0}
:root .places li{position:relative;grid-template-columns:minmax(0,1fr) 132px;gap:0;margin-left:0;padding:0 0 0 26px;border:0}
:root .places li+li{border-top:1px solid var(--line)}
:root .places li::before{content:"";position:absolute;left:8px;top:0;bottom:0;width:1px;background:var(--line)}
:root .places li:first-child::before{top:34px}
:root .places li:last-child::before{bottom:calc(100% - 34px)}
:root .places li::after{content:"";position:absolute;left:3px;top:29px;width:11px;height:11px;border:1.5px solid var(--ink);border-radius:50%;background:var(--bg2)}
:root .places li.is-act{background:none}
:root .places li.is-act::after{border-color:var(--gold-d);background:var(--gold-d);animation:p-beat-l .5s ease-out both}
:root .places li.is-act .pl-n b{font-weight:var(--w-strong)}
:root .pl{grid-column:1/3;grid-row:1;min-height:0;padding:10px 0 12px;justify-content:flex-start}
:root .pl-n{min-height:48px;padding-right:140px}
:root .pl-a{display:block}
:root .pl-t{position:relative;z-index:1;grid-column:2;grid-row:1;align-self:start;margin-top:10px;padding:0 6px}
:root .places li.is-act .pl-t{background:var(--gold-soft)}
:root .tag-here{border:0;background:none;padding:0;color:var(--gold-d)}
@media(hover:hover){
:root .cat:hover::before,:root .reg:hover::before{transform:scaleX(1)}
:root .cat:hover>.ic:first-child,:root .reg:hover .mm{background:var(--gold-soft)}
:root .names button:hover::before{transform:scaleY(7)}
}
@media(max-width:520px){
:root .cat{grid-template-columns:60px minmax(0,1fr);column-gap:14px;min-height:76px;padding-right:40px}
:root .cat>.ic:first-child{width:60px;min-height:76px;padding:0 16px}
:root .cat b{font-size:26px}
:root .cat-s{grid-template-columns:60px minmax(0,1fr);grid-template-rows:1fr auto auto 1fr;min-height:72px}
:root .cat-s>.ic:first-child{grid-row:1/5;min-height:72px;padding:0 18px}
:root .cat-s b{grid-row:2;font-size:19px}
:root .cat-s span{grid-column:2;grid-row:3}
:root .cat::after,:root .reg::after{right:18px}
:root .reg{grid-template-columns:48px minmax(0,1fr);grid-template-rows:1fr auto auto 1fr;column-gap:12px;min-height:76px;padding-right:40px}
:root .reg .mm{grid-row:1/5;width:48px;min-height:76px;padding:6px 3px}
:root .reg b{grid-column:2;grid-row:2}
:root .reg span{grid-column:2;grid-row:3;padding-bottom:6px}
:root .hd{padding:16px 88px 16px 14px}
:root .scope,:root .addr,:root .acts,:root .links{margin-left:14px;margin-right:14px}
:root .places{margin:6px 8px 0}
/* 手機：名稱一行、地址一至兩行、總機一行 */
:root .places li{grid-template-columns:minmax(0,1fr)}
:root .pl{grid-column:1;padding:12px 0 6px}
:root .pl-n{min-height:0;padding-right:0}
:root .pl-t{grid-column:1;grid-row:2;justify-self:start;margin:0 0 14px;padding:0 14px}
:root .places li::after{top:20px}
:root .places li:first-child::before{top:25px}
:root .places li:last-child::before{bottom:calc(100% - 25px)}
}

/* ═════ 第 7 版第二批（律師 115.11.14 裁示）：地圖標籤、高等行政法院加註、返回連結貓腳印、類別頁五塊掛牌等大 ═════ */
/* 地圖標籤：亮起轄區上的區名用深字金邊；放不下而拉到海上的縣市名有一條細引線 */
.lb-jur{fill:var(--bd);stroke:var(--glow);font-weight:500}
.lb-lead{fill:none;stroke:rgba(246,242,232,.75)}
.lb-dot{fill:var(--cream)}
/* 高等行政法院名稱下的一行 */
.names button.has-sub{flex-wrap:wrap;align-content:center}
.nm-sub{flex:0 0 100%;font:400 14px/1.5 var(--f-body);letter-spacing:.04em;color:var(--muted)}
.has-sub .ic-go{display:none}
.hd-note{font-size:15px;line-height:1.6;color:var(--muted)}
:root .hd-note{color:var(--p-on-m)}

/* 返回連結：三枚貓腳印往回走（取代折返路線；律師定案採 A） */
:root[data-back] .cm-back .rt{position:relative;display:flex;align-items:center;width:auto;height:auto}
:root[data-back] .cm-back .rt::before{display:none}
.bk-paw{display:block;flex:none;fill:var(--gold)}
@keyframes p-step{0%{opacity:0;transform:rotate(-90deg) scale(.4)}100%{transform:rotate(-90deg) scale(1)}}
/* 腳印帶路：三枚腳印一左一右往回走，越遠越小越淡；滑過或聚焦時由近到遠依序踩下 */
:root[data-back="a"] .cm-back .rt{gap:1px}
:root[data-back="a"] .bk-paw{transform:rotate(-90deg)}
:root[data-back="a"] .bk-p1{width:11px;height:12px;margin-top:-8px;opacity:.4}
:root[data-back="a"] .bk-p2{width:13px;height:14px;margin-top:8px;opacity:.7}
:root[data-back="a"] .bk-p3{width:16px;height:17px;margin-top:-8px}
:root[data-back="a"] .cm-back:hover .bk-paw,:root[data-back="a"] .cm-back:focus-visible .bk-paw{animation:p-step .3s ease-out both}
:root[data-back="a"] .cm-back:hover .bk-p2,:root[data-back="a"] .cm-back:focus-visible .bk-p2{animation-delay:.13s}
:root[data-back="a"] .cm-back:hover .bk-p1,:root[data-back="a"] .cm-back:focus-visible .bk-p1{animation-delay:.26s}
@media(max-width:350px){:root[data-back] .cm-back .rt{display:flex}}

/* 第 7 版：類別頁五塊掛牌等大（民事、刑事、行政、專業法院、用所在地查管轄），同高同寬、標題同字級、副標同位置；各選項頁同層級的掛牌也等大 */
:root .cats{grid-auto-rows:88px}
:root .cat,:root .cat-s{width:auto;height:88px;min-height:0;margin-top:0;grid-template-columns:72px minmax(0,1fr);grid-template-rows:1fr auto auto 1fr;column-gap:18px}
:root .cat>.ic:first-child,:root .cat-s>.ic:first-child{grid-row:1/5;width:72px;min-height:0;padding:0 20px}
:root .cat b,:root .cat-s b{grid-column:2;grid-row:2;font-size:28px;letter-spacing:.08em}
:root .cat span,:root .cat-s span{grid-column:2;grid-row:3;white-space:nowrap}
:root .cats-alt{margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}
:root .regs,:root .names{grid-auto-rows:1fr}
@media(max-width:1100px){
:root .cat b,:root .cat-s b{font-size:26px}
}
@media(max-width:520px){
:root .cats{grid-auto-rows:76px}
:root .cat,:root .cat-s{height:76px;grid-template-columns:60px minmax(0,1fr);column-gap:14px}
:root .cat>.ic:first-child,:root .cat-s>.ic:first-child{width:60px;padding:0 16px}
:root .cat b,:root .cat-s b{font-size:26px}
:root .cats-alt{margin-top:12px;padding-top:12px}
}
@media(max-width:350px){
:root .cat b,:root .cat-s b{font-size:21px;letter-spacing:.04em}
}
/* 第 7 版第三批微調 */
:root .cat,:root .cat-s{row-gap:0}
:root[data-back="a"] .bk-p1{width:13px;height:14px;margin-top:-9px;opacity:.45}
:root[data-back="a"] .bk-p2{width:16px;height:17px;margin-top:9px;opacity:.75}
:root[data-back="a"] .bk-p3{width:19px;height:20px;margin-top:-9px}
:root[data-back="a"] .cm-back .rt{gap:2px;margin-right:2px}
/* 第 7 版第四批微調 */
:root .addr{font-size:17px;line-height:1.6}
@media(max-width:350px){
:root .addr,:root .pl-a{font-size:16px}
:root .scope,:root .addr,:root .acts,:root .links{margin-left:10px;margin-right:10px}
}
:root[data-back="a"] .bk-p1{width:15px;height:16px;margin-top:-10px;opacity:.5}
:root[data-back="a"] .bk-p2{width:18px;height:19px;margin-top:10px;opacity:.8}
:root[data-back="a"] .bk-p3{width:22px;height:23px;margin-top:-10px}

/* 第 7 版第十一批（獨立驗收回件） */
/* 腳印旁的字：以中線定位，方便與界線做避讓；四周都放不下時不顯示 */
.mk-t{dominant-baseline:middle}
.mk-t.is-off{display:none}
/* 名稱不留孤字：兩行時兩行長度盡量平均 */
.hd h2,.names button,.rows b,.pl-n b,.cm-cap b{text-wrap:balance}
/* 清單各列等高：按鈕撐滿所在的列；同一頁有任何一列折成兩行時（.is-tall）各列一起加高 */
:root .names li{display:grid}
:root .names button{min-height:64px}
:root .cm-pick.is-tall .names button{min-height:92px}
/* 機關卡下方可點的列（上級法院、檢察署、少年家事）：加上與掛牌一致的細金箭頭 */
:root .rows button{grid-template-columns:5.2em minmax(0,1fr) auto}
:root .rows button::after{content:"";width:8px;height:8px;margin:0 10px 0 12px;border-top:1.5px solid var(--gold-d);border-right:1.5px solid var(--gold-d);transform:rotate(45deg)}
:root .pl-u{display:block}
@media(max-width:350px){
:root .names button{font-size:18px}
}

/* 第 7 版第十二批：點亮起的區塊顯示區名（律師定案）。被點到的區名用亮字深邊，放在區外時拉一條短線 */
.lb-tap{fill:#fff6d8;stroke:var(--bd);font-weight:600}
.lb-tapline{stroke:#fff6d8}
.has-jur .lit{pointer-events:none}
#map:focus-visible{outline-offset:-4px}

/* 第 7 版第十四批：腳印旁的字放得較遠時的引線 */
.mk-lead{stroke:rgba(246,242,232,.85);stroke-width:1.4px}

/* 第 7 版第十六批：固定插圖框的框名碰到陸地界線時不顯示 */
.inset-t.is-off{display:none}

/* 第 7 版第十八批：角落離島框的底板（與海面同色） */
.far-plate{fill:var(--bd);stroke:none}

/* 第 7 版第十九批：地圖說明列底板 */
:root .cm-cap{right:auto;max-width:calc(100% - 40px);padding:6px 14px 8px;background:var(--bd);box-shadow:0 0 0 1px rgba(246,242,232,.18)}
@media(max-width:900px){
:root .cm-cap{max-width:calc(100% - 24px);padding:4px 10px 6px}
}

/* 第 7 版第二十四批：點地圖時不畫焦點框 */
#map:focus:not(:focus-visible){outline:none}
/* 驗收修正輪：院區列總機為官方號碼範圍或多組者，總機改放第二層（地址下方），各支一鈕、放不下換行 */
:root .pl-ts{grid-column:1/3;grid-row:2;display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
:root .pl-ts .pl-t{margin:0}
@media(max-width:520px){:root .pl-ts{grid-column:1;margin:0 0 14px}}
