@charset "utf-8";

@media screen and (max-width: 1000px) {
    .wrap { padding:0; }
}
@media screen and (max-width: 500px) {
    span.note { padding: 0 0 0 10px; }
}

h2 > p { font-weight:normal; color:#555; line-height: 1.2; padding:5px 0; }
/* ---------------------------- 3項說明 */	
.legend3 { width:100%; display:flex; flex-wrap:nowrap; justify-content:space-between; margin: 10px 0 25px; }
.legend3 > div { width:30%; padding:14px 20px 15px; border-radius:8px; color:#444; position:relative; border:1px solid #e5dfdf;
background:-webkit-radial-gradient(circle farthest-corner at right bottom, #7adaf717 10%, #8762ed21 100%);
background:-o-radial-gradient(circle farthest-corner at right bottom, #7adaf717 10%, #8762ed21 100%);
background:radial-gradient(circle farthest-corner at right bottom, #7adaf717 10%, #8762ed21 100%); }
.legend3 > div:before { content:""; float:left; display:inline-block; width:30px; height:30px; background-color:#5c4a72; border-radius:100%; margin: 15px 12px 10px 0; }
.legend3 > div:nth-of-type(2):before { background-color:#a3586d; }
.legend3 > div:nth-of-type(3):before { background-color:#f3b05a; }
.legend3 > div > b { float:left; width:calc(100% - 50px); font-size:20px; color:#222; }
.legend3 > div > b > small { font-weight:normal; font-size:14px; } /*縣市*/
.legend3 > div > b > span { display:block; font-size:14px; color:#555; line-height:1.2; font-weight:normal; }

.legend3 > div:after { content:""; position: absolute; top: 0; left: 16px; right: 16px; height: 2px; opacity: .95;
background: linear-gradient(90deg, rgb(143 122 167 / 0), rgb(167 150 186 / .7) 18%, #8f7aa7 50%, rgb(187 174 200 / .72) 82%, rgb(143 122 167 / 0)); }
.legend3 > div:nth-of-type(2):after 
{ background: linear-gradient(90deg, rgb(163 88 109 / 0), rgb(192 122 146 / .72) 18%, #a3586d 50%, rgb(208 154 173 / .74) 82%, rgb(163 88 109 / 0)); }
.legend3 > div:nth-of-type(3):after
{ background: linear-gradient(90deg, rgb(243 176 90 / 0), rgb(225 162 79 / .72) 18%, #f3b05a 50%, rgb(240 199 136 / .78) 82%, rgb(243 176 90 / 0)); }

@media screen and (max-width:1000px){
	.legend3 > div { width:32%; padding:14px 10px 10px 15px; }
	.legend3 > div:before { width:20px; height:20px; margin: 10px 12px 25px 0; }
	.legend3 > div > b { width:calc(100% - 35px); }
}
@media screen and (max-width:900px){
	.legend3 > div:before { width:10px; height:10px; margin:10px 10px 25px 0; }
	.legend3 > div > b { width:calc(100% - 20px); }
}
@media screen and (max-width:700px){
	h2 > p { padding:5px 0 15px; }
	
	.legend3 { flex-wrap:wrap; padding:15px 8px 10px 15px; margin:0; border:1px solid #e5dfdf; border-radius:8px;
		background:-webkit-radial-gradient(circle farthest-corner at right bottom, #7adaf717 10%, #8762ed21 100%);
		background:-o-radial-gradient(circle farthest-corner at right bottom, #7adaf717 10%, #8762ed21 100%);
		background:radial-gradient(circle farthest-corner at right bottom, #7adaf717 10%, #8762ed21 100%); }
	.legend3 > div { width:100%; background:none; border:none; margin:0 auto 10px; padding:0; }
	.legend3 > div:before { margin:8px 10px 0 0; }
	.legend3 > div:after { display:none; }
	.legend3 > div > b { width:auto; display:inline-block; line-height:28px; padding:0; }
	.legend3 > div > b > span { display:inline-block; padding:0 0 0 8px; }
}	
	
	
/* ---------------------------- 切頁選單 */
.CityMenu { flex-wrap:nowrap; padding: 15px 10px 15px 15px; }
.CityMenu > ul { display:flex; gap:10px; width:100%; overflow-x: auto; overflow-y:hidden; scrollbar-width: thin; }
.CityMenu > ul > li { float:left; }
.CityMenu > ul > li a { display:inline-block; color:#222; font-size:18px; font-family:'Noto Sans TC'; font-weight:500; letter-spacing:2px; text-decoration:none; padding:5px 15px 6px; border-radius:8px; white-space:nowrap; }
.CityMenu > ul > li > a:hover { background:rgb(144, 214, 245); }
.CityMenu > ul > li > a.active { background:#055ab0e8; color:#fff; }
.CityMenu > ul > li > a:focus-visible { outline:3px solid #055ab066; outline-offset:2px; }


.is-hidden { display:none; }
/* ---------------------------- 圖表 */
/* 圖表共用 */
.statisticsWrap { width:100%; padding:15px 15px 20px; border-radius:8px; margin:0 auto; 
background:-webkit-linear-gradient(top, #99cdd057 0%, #fff 50%); background: -o-linear-gradient(top, #99cdd057 0%, #ffffff 50%);
background:linear-gradient(top, #99cdd057 0%, #ffffff 50%); }
.statisticsWrap[hidden] { display:none; }
/* 圖表表頭 */
.SWhead { display:flex; flex-wrap:wrap; justify-content:space-between; border-bottom:1px solid #ccc; padding:0px 15px 10px; gap:12px 0; }
/* 圖表表頭 - (左)標 */
.SWhead .TIT { display:flex; align-items:flex-start; gap:12px; }
.SWhead .TIT > b { display:block; width:40px; height:34px; background-color:#a8d8f0; text-align:center; font-size:20px; color:#044a82; border-radius:8px; padding:0 7px; }
.SWhead .TIT > h3 { font-size:23px; font-family:'Noto Sans TC'; font-weight:500; padding:0; }
.SWhead .TIT > h3 span { display:block; margin-top:8px; color:#555; font-weight:normal; }
.SWhead .TIT > h3 span:before { content:""; display:inline-block; width:5px; height:20px; background-color:#f3b05a; vertical-align:bottom; border-radius:2px; margin: 0 7px 0 0; }
/* 圖表表頭 - (右BT) 只有圖1使用 */
.SWhead .BT { display:flex; justify-content:flex-end; align-items:center; gap:12px; text-align:right; }
/* 圖表內容 */
.SWbody { min-height:200px; padding:15px 15px 0; }
/* 政党圖標 */
.SWbody ul { overflow:hidden; }
.SWbody ul > li { float:left; margin:0 20px 0 0; }
.SWbody ul > li:before { content:""; display:inline-block; width:15px; height:15px; border-radius:4px; margin:0 5px 3px 0; vertical-align:text-bottom; }
.SWbody ul > li:nth-of-type(1):before { background-color:rgb(63, 156, 90); }
.SWbody ul > li:nth-of-type(2):before { background-color:rgb(59, 111, 212); }
.SWbody ul > li:nth-of-type(3):before { background-color:rgb(58, 166, 160); }
.SWbody ul > li:nth-of-type(4):before { background-color:#888; }
.SWbody > .note { padding:5px 0 0; }
/* 圖表內容 */
.SWbody > .chartBox { width:100%;  margin:10px auto; }
#sec02 > .SWbody > .chartBox,
#sec03 > .SWbody > .chartBox, 
#sec04 > .SWbody > .chartBox, 
#sec05 > .SWbody > .chartBox { width:90%; text-align:center; margin:20px auto 0; }


/* ----- 圖 1 */
#sec01.statisticsWrap { padding: 15px 15px 0px; }
#sec01 > .SWbody > .chartBox { display:grid; grid-template-columns:35% 45% 20%; margin:0 auto; }
#sec01 > .SWbody ul { margin-bottom:20px; }
#sec01 > .SWbody > .chartBox .note { padding:0; line-height:1.5; }
/* 兩屆版圖切換 */
.SWhead .BT > button { height:36px; font-size:17px; letter-spacing:1px; line-height:32px; background-color:#fff; color:#055ab0; padding:0 15px; border:2px solid #055ab099; border-radius:8px; cursor:pointer; }
.SWhead .BT > button.active,
.SWhead .BT > button.active:hover { background-color:#055ab0e8; color:#fff; }
.SWhead .BT > button:hover { background-color:#9addfb; }
/* 在政黨方塊後加上席次 */
.gridL ul li i { color:#ab415f; }
.gridL ul li i:before { content:" _"; color:#ab415f; }
/* svg 地圖 */
.map { min-height:300px; display:grid; place-items:center; color:#aaa; position:relative; }
.map.is-hidden { display:none; }
.map svg { width:80%; }
.map path { cursor:pointer; }
.map path:hover, .map path:focus-visible { filter:brightness(0.9); outline:none; }
.map path:focus { outline:none; }
/* 3外島 */
.islands { width:100%; display:flex; flex-wrap:nowrap; flex-direction:column; gap:20px 0; justify-content:right; margin:20px 0 0; }
.islands button { width: 100px; display:flex; flex-direction:column; align-items: center; gap: 8px; padding: 12px 10px; border:1px solid #dcd5d5; border-radius:10px; background-color:#f7f7f7; cursor:pointer; }
.islands button i { width: 34px; height: 34px; border-radius:8px; }
.islands button:hover, .islands button:active { background-color:rgba(3,3,3,0.05); }
/* 浮動面版：各地區縣市長得票數/率 */
.mapInfo { position:fixed; z-index:1001; width:300px; max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); overflow-y:auto; pointer-events:none; text-align:left; border:1px solid #d8e2e5; border-radius:8px; background-color:#f4f7f8e8; color:#222; box-shadow: 0px 4px 5px 0 rgba(69, 61, 61, 0.15); }
.mapInfo[hidden], .mapInfoBackdrop[hidden] { display:none; }
.mapInfoBackdrop { position:fixed; inset:0; z-index:10; background:rgba(0,0,0,0.55); touch-action:none; }
.mapInfo.is-popup { pointer-events:auto; max-height:none; overflow:visible; background-color:#fff; }
.mapInfo.is-popup .mapInfoContent { max-height:calc(100dvh - 100px); overflow-y:auto; overscroll-behavior:contain; }
/* 關閉BT */
.mapInfo > .mapInfoClose { position:absolute; top:-12px; right:-12px; display:grid; place-items:center; width:40px; height:40px; margin:0; padding:0 0 3px 0; border:0; border-radius:50%; background:#fff; color:#333; font-size:28px; cursor:pointer; }
.mapInfoClose:hover { background:#d8e2e5; }
.mapInfoClose:focus-visible { outline:2px solid #055ab0; outline-offset:-4px; }
/* 縣市+當選資訊 */
.mapInfo strong { display:block; font-size:1.15rem; padding:12px 15px 0; }
/* 當選註記 */
.mapInfo strong span.elected { --Ewei:0.2rem; transform: scale(0.85); translate:0px 5px; margin:0 6px; }
/* 政黨小圖 */
.mapInfo strong img.pp { margin: -6px 0 0 5px; }
/* 縣市長列表 */
.mapCandidates { display:flex; flex-wrap:wrap; gap:5px 16px; padding: 15px 16px 10px; }
.mapCandidates b { display: block; width:100%; font-size:16px; line-height: 1.3; padding:0 0 5px 0; }
.mapCandidates b span { display:inline-block; width:10px; height:10px; border-radius:100%; background-color: #888; margin: 0 5px 1px 0; }


/* ----- 圖 2：政黨得票率 */
.partyPercentageChart svg { display:block; width:100%; max-width:100%; height:auto; }
.partyPercentageChart:focus-visible { outline:2px solid #055ab0; outline-offset:3px; }
.percentageGrid line { stroke:#b4c5ca; stroke-dasharray:3 3; }
/* XY軸文字 */
.percentageAxis { font-family:inherit; font-size:13px; color:#333; letter-spacing: 0; }
/* X軸 (.eventBoundary) line color */
.percentageAxis .domain { stroke:#7f8c92; }
/* percentageSeries → 折線(path)+圓點(circle) */
/* hover的虛線 */
.percentageGuide { stroke:#84939b; stroke-width:1; stroke-dasharray:4 4; pointer-events:none; }
/* 圖 2 提示框 */
.percentageTooltip { position:fixed; z-index:100; max-width:calc(100vw - 16px); box-sizing:border-box; padding:12px 16px; border:1px solid #d8e2e5; border-radius:8px; background:#fff; color:#333; box-shadow:0 4px 16px #0002; font-size:14px; line-height:1.6; text-align:left; pointer-events:none; }
.percentageTooltip[hidden] { display:none; }
.percentageTooltip > strong { display:block; margin-bottom:6px; }
.percentageTooltip > div { display:flex; align-items:center; gap:8px; }
.percentageTooltip b { margin-left:auto; padding-left:12px; font-variant-numeric:tabular-nums; }
.percentageTooltipDot { width:9px; height:9px; border-radius:50%; flex-shrink:0; }


/* ----- 圖 3 */
/* 標 */
.chartBox .bar h4 { font-size:20px; text-align:left; }
.chartBox .bar h4 > p { display:inline-block; color:#666; padding:0 0 0 10px; }
/* bar */
.bar:first-child { margin:0 0 30px; }
.powerRow { margin:10px 0 16px; }
.powerRow > div { display:flex; gap:3px; height:38px; margin-top:6px; overflow:hidden; border-radius:8px; }
.powerRow > div > span { display:grid; min-width:30px; padding:5px 0 8px; text-align:center; color:#fff; font-size:16px; font-weight:bold; }
.powerRow > b { display:block; text-align:left; padding: 0 7px; }
.powerRow > .seatTrack { gap:0; }
.powerRow > .seatTrack > .seatSegment { box-sizing:border-box; flex-shrink:0; min-width:0; padding:5px 0 8px; border-right:2px solid #fff; }
.powerRow > .seatTrack > .seatSegment:last-child { border-right:0; }
p.deltas { display:flex; align-items:center; gap:0 20px; flex-wrap:wrap; padding:0px 14px; color:#6f7780; font-size:16px; line-height:1.6; }
.deltasLead { color:#476e87; }
.deltaItem > b:first-child { padding:0 5px 0 0; }
.deltaItem:after { content:"|"; font-size:16px; color:#ccc; padding: 0 0 0 18px; }
.deltaItem:last-child:after { display:none; }


/* ----- 圖 4 */
.ranking { display:grid; margin-top:20px; }
/* % 表頭 (圖 4 + 5) */
.scale { display:grid; grid-template-columns:120px 1fr; align-items:end; gap:12px; margin-bottom:10px; }
.scale > div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.scale > div > span { font-size:14px; }
/* 長條圖 */
/* 圖 4 + 5 共用 */
.R_row { display:grid; grid-template-columns:120px 1fr; gap:12px; align-items:center; margin: 0 0 18px; }
.R_row > b { color:#333; }
/* 圖 4長條圖 */
.R_row > span { height:25px; overflow: hidden; background:repeating-linear-gradient(90deg,#d5efec 0 1px,transparent 1px calc(100% / 7)),#d8eaecb2; }
.R_row > span > i { height:100%; display:flex; align-items:center; justify-content:flex-end; padding-right:8px; color:#fff; font-size:13px;font-style: normal; font-weight:bold; }
/* 六都 */
.R_row > b.metro { color:#982b4a; }


/* ----- 圖 5 */
.reelection { display:grid; margin:25px auto 0; }
/* 圖 5 長條圖 */
.R_row > div { display:grid; align-items:center; gap:5px 0; }
.R_row .metricLine { min-width: 0; }
.R_row .metricBar { position:relative; width:100%; background: repeating-linear-gradient(90deg,#eaeaea 0 1px,transparent 1px calc(100% / 8)),transparent; }
/* 長條圖 (bar) */
.metricBar span { display: block; height:12px; border-radius:2px; }
.metricBar .before { opacity:0.4; } /* 上一屆 */
.metricBar .after { background: var(--party); } /* 本屆 */
/* 長條圖 (數字) */
.metricBar em.valueLabel { font-size:13px; font-style:normal; white-space:nowrap; transform:translateY(-50%); color:var(--party); padding:0 0 0 5px; position:absolute; top:50%; }
.metricBar .beforeLabel {  } /* 上一屆 */
.metricBar .afterLabel { font-weight:bold; } /* 本屆 */
/* 未連任 */
.metricBar .lost { border: 1.5px dashed var(--party); background: color-mix(in srgb,var(--party) 12%,transparent); }


@media screen and (max-width:950px) {
	/* 圖 1 */
	#sec01 > .SWbody > .chartBox { grid-template-columns:30% 55% 15%; }
	.map svg { width:75%; }

	#sec02 > .SWbody > .chartBox { width:100%; }
}
@media screen and (max-width:850px) {
	/* 圖 1 */
	.islands button { width:90px; padding:8px 8px 12px; }
	.islands button i { width:28px; height:28px; }
}
@media screen and (max-width:750px) {
	.SWhead .BT { margin-left:auto; }
	/* 圖 1 */
	#sec01 > .SWbody > .chartBox { grid-template-columns:1fr; }
	.map svg { width:50%; }
	.islands { flex-direction:row; gap: 0 20px; justify-content: center; margin:10px auto 20px; }
	.map svg { width: 100%; max-width: 320px; }
	
	#sec03 > .SWbody > .chartBox, 
	#sec04 > .SWbody > .chartBox, 
	#sec05 > .SWbody > .chartBox { width:100%; }
}
@media screen and (max-width:600px) {
	.SWhead { padding:0 0 10px; }
	.SWbody { padding:15px 0; }
	
	/* 圖 4 + 5 */
	.scale, .R_row { grid-template-columns:100px 1fr; gap:5px; }
	.R_row b, .R_row b > small { font-size:14px; letter-spacing:0; text-align:left; line-height:1.3; }
}
@media screen and (max-width:500px) {
	.legend3 > div > b { width: calc(100% - 22px); padding:0; line-height: 22px; }
	.legend3 > div > b > span { padding:0; }

	/* 圖 4 + 5 */
	.scale, .R_row { grid-template-columns:60px 1fr; gap:5px; }
	.R_row b, .R_row b > small { font-size:13px; display:block; }
	/* 圖5 */
	.metricBar em.valueLabel { padding:0 0 0 3px; letter-spacing: 0; }
}
@media screen and (max-width:360px) {
	/* 圖 1 */
	.SWhead .BT > button { padding:0 10px; }
	.islands { width: 90%; }
	/* 圖5 */
	.reelection > .scale, 
	.reelection > .R_row { grid-template-columns:55px 1fr; }
}
