:root{--paper:#f5f6f8;--ink:#161c2c;--sub:#505a6b;--border:#dce1ea;--brand:#a12263;--hot:#ff91bf;--navy:#15182d;--pink:#fae4ef;--panel:#fff;--positive:#a12263;--negative:#255ca6}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--paper);color:var(--ink);font-family:"Noto Sans TC","PingFang TC","Microsoft JhengHei",system-ui,sans-serif;font-size:16px;line-height:1.55;font-variant-numeric:tabular-nums}
a{color:inherit;text-decoration:none}
button,select,input{font:inherit}
button{cursor:pointer}
button:disabled{cursor:default;opacity:.45}
:focus-visible{outline:3px solid #ac2b74;outline-offset:3px}
.frame{width:min(1296px,calc(100% - 72px));margin-inline:auto}
.masthead{background:white;border-bottom:1px solid var(--border)}
.nav{display:flex;align-items:center;justify-content:space-between;min-height:66px;gap:20px}
.brand{display:flex;align-items:center;gap:10px;font-weight:850;white-space:nowrap}
.mark{width:28px;height:28px;background:#f7e1ec;border-radius:7px;display:flex;align-items:end;justify-content:center;gap:2px;padding-bottom:6px}
.mark i{width:3px;background:var(--brand);border-radius:2px;height:7px}.mark i:nth-child(2){height:12px}.mark i:nth-child(3){height:16px}
nav{display:flex;align-items:center;gap:25px;color:#394254;font-size:.92rem;font-weight:650}
nav a:hover,.link-button:hover{text-decoration:underline}
section{scroll-margin-top:22px;margin:32px 0 49px}
.hero{position:relative;overflow:hidden;background:radial-gradient(ellipse at 93% 24%,#43243f 0%,transparent 54%),var(--navy);color:white;border-radius:22px;display:grid;grid-template-columns:1fr 1fr;gap:38px;align-items:center;padding:39px 52px 43px}
.hero:before{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(105deg,transparent 60%,#bb388814)}
.hero>*{position:relative}
.eyebrow{margin:0 0 8px;font-size:.86rem;letter-spacing:.13em;color:var(--brand);font-weight:750}
.hero .eyebrow{color:#ffc1db;display:flex;align-items:center;gap:10px}
.eyebrow span{width:18px;height:2px;background:currentColor}
h1,h2,h3,p{margin-top:0}
h1{font-size:clamp(3rem,5.6vw,5.3rem);line-height:1.06;letter-spacing:-.055em;margin-bottom:16px;font-weight:880}
h1 em{font-style:normal;color:var(--hot)}
.intro{color:#e3deea;margin-bottom:21px}
.hero-button,.button{display:inline-flex;align-items:center;justify-content:center;min-height:40px;border-radius:9px;padding:7px 15px;font-size:.9rem;font-weight:760}
.hero-button{background:#ffc1dc;color:#341c39}
.hero-button:hover{background:#ffdaea}
.hero-graphic{background:#17142691;border:1px solid #c7b4d645;border-radius:16px;padding:16px 21px 9px}
.graphic-label{display:flex;justify-content:space-between;color:#f8dfef;font-size:.87rem;font-weight:650}
.graphic-label span:last-child{color:#e2b8cd}
#hero-chart svg{display:block;width:100%}
.controls{margin:22px 0 24px;display:flex;align-items:end;gap:15px;background:var(--panel);padding:15px 18px;border:1px solid var(--border);border-radius:13px}
.controls label{min-width:175px}
.scope{margin-left:auto;color:var(--sub);padding-bottom:8px;font-size:.9rem;text-align:right}
label{font-size:.9rem;font-weight:730;display:flex;flex-direction:column;gap:5px;min-width:0}
select,input{color:var(--ink);width:100%;border:1px solid #cbd2df;border-radius:8px;background:#fff;padding:7px 11px;min-height:42px}
select{appearance:none;padding-right:33px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 5 4 4 4-4' fill='none' stroke='%23505a6b' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");background-position:right 10px center;background-repeat:no-repeat}
.section-head{display:flex;justify-content:space-between;align-items:flex-end;gap:14px;margin-bottom:16px}
.section-head.compact{align-items:center;margin-bottom:12px}
.section-head h2,.section-head h3,.section-head p{margin-bottom:0}
.section-head h2{font-size:clamp(1.42rem,2.6vw,2.08rem);letter-spacing:-.035em}
.section-head h3,h3{font-size:1.15rem;font-weight:840}
.section-head span:not(.sr-only),.muted{font-size:.9rem;color:var(--sub)}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:13px;margin-bottom:15px}
.stat,.panel{border:1px solid var(--border);background:var(--panel);border-radius:14px}
.stat{padding:14px 18px}
.stat:first-child{background:#fcedf5;border-color:#efd0e0}
.stat span,.stat small{display:block;color:var(--sub);font-size:.86rem}
.stat strong{display:block;font-size:clamp(1.4rem,3vw,2.15rem);line-height:1.26;letter-spacing:-.055em;margin:4px 0}
.stat:first-child strong{color:var(--brand)}
.panel{padding:20px}
.overview-grid{display:grid;grid-template-columns:1.12fr 1fr;gap:15px}
.candidate{margin:13px 0 15px}
.candidate-line{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:.92rem}
.candidate-line b{overflow-wrap:anywhere}
.candidate-line span{color:var(--sub);white-space:nowrap}
.candidate-line strong{color:var(--ink);margin-left:5px}
.bar{margin-top:5px;height:8px;background:#eaedf2;border-radius:6px;overflow:hidden}
.bar>span{display:block;height:100%;border-radius:6px}
.insights{background:#fcf9fc}
.insight{border-top:1px solid #eadce7;padding:10px 0 8px}
.insight:last-child{padding-bottom:0}
.insight h4{margin:0 0 3px;font-size:.96rem}
.insight p{font-size:.9rem;color:var(--sub);margin:0}
#scope-note:empty{display:none}
#scope-note{margin-bottom:0}
#trend-chart{max-width:920px;margin:0 auto 13px}
#trend-chart svg{width:100%;display:block}
.legend{display:flex;flex-wrap:wrap;justify-content:center;gap:9px 20px;font-size:.88rem;color:var(--sub)}
.legend i,.dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:6px;background:var(--dot)}
.table-wrap{overflow:auto;border:1px solid var(--border);border-radius:9px}
.scroll-rows{max-height:444px}
table{width:100%;border-collapse:separate;border-spacing:0;min-width:630px;font-size:.9rem}
td,th{padding:9px 12px;border-bottom:1px solid #e9edf3;text-align:right;white-space:nowrap}
td:first-child,th:first-child{text-align:left}
thead th{background:#edf0f5;color:#394255;position:sticky;top:0;z-index:1;font-weight:770}
tbody tr:nth-child(even){background:#fafbfc}
tbody tr:hover{background:#fdf1f7}
tbody tr:last-child td{border-bottom:0}
.detail-cell{text-align:left}
.subtle{color:var(--sub);font-size:.83rem}
.link-button{border:0;background:none;color:var(--brand);padding:0;font-weight:760;text-align:left}
.button{border:1px solid #cbd2de;background:#fff;color:#303a50;white-space:nowrap}
.button:hover:not(:disabled){background:#f3e6ef}
.button.primary{background:var(--brand);color:#fff;border-color:var(--brand)}
.button.primary:hover{background:#821852}
.change-panel{margin-top:15px}
.filter-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.explorer-filters{grid-template-columns:repeat(3,minmax(0,1fr))}
.summary-line{color:var(--sub);font-size:.9rem;margin:12px 0 9px}
.positive{color:var(--positive)}.negative{color:var(--negative)}
.pagination{display:flex;gap:14px;align-items:center;justify-content:flex-end;margin-top:12px;font-size:.9rem;color:var(--sub)}
.methodology{display:grid;grid-template-columns:1fr 1fr;gap:28px}
.methodology h3{margin-bottom:8px}
.methodology ul{margin:0;padding-left:21px;color:var(--sub)}
.methodology li{margin-bottom:7px}
details{border-top:1px solid var(--border);padding:9px 0}
summary{cursor:pointer;font-size:.88rem;overflow-wrap:anywhere;font-weight:650}
details p{margin:4px 0 0;font-size:.86rem;color:var(--sub)}
footer{border-top:1px solid var(--border);padding:20px 0 25px;font-size:.9rem;color:var(--sub)}
footer .frame{display:flex;justify-content:space-between;gap:10px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:820px){.frame{width:calc(100% - 32px)}.hero{padding:29px;gap:15px}.overview-grid,.methodology{grid-template-columns:1fr}.scope{max-width:190px}.filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}nav{gap:12px}}
@media(max-width:590px){.nav{display:block;padding-block:10px}.nav nav{margin-top:6px;justify-content:space-between;gap:5px;font-size:.82rem}.hero{grid-template-columns:1fr;padding:24px;gap:20px}.hero-graphic{padding-inline:12px}.controls{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px}.controls label{min-width:0}.scope{grid-column:1/-1;max-width:none;padding-bottom:0;text-align:left;margin-left:0}.stats{grid-template-columns:1fr 1fr;gap:8px}.stat{padding:9px 12px}.panel{padding:13px}.section-head{gap:8px}.section-head>label{max-width:120px}.section-head.compact>span{text-align:right}.candidate-line span{white-space:normal;text-align:right}section{margin:20px 0 37px}#detail .section-head h2{font-size:1.25rem}.filter-grid{gap:8px}.button{padding-inline:10px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
dialog{width:min(92vw,670px);max-height:85vh;padding:20px;border:1px solid var(--border);border-radius:15px;color:var(--ink)}
dialog::backdrop{background:#111525a6}
dialog table{min-width:0}
dialog td:first-child{white-space:normal}

.pres-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.pres-card{border:1px solid var(--border);border-radius:10px;padding:14px 17px;background:#fafbfe;min-width:0}
.pres-card h4{margin:0;font-size:1.1rem}
.pres-card .candidate:last-child{margin-bottom:4px}
.pres-summary{margin:14px 0 0}
.pres-filters{grid-template-columns:repeat(2,minmax(0,240px))}
.detail-note{margin:12px 0 0}
@media(max-width:590px){.pres-grid{grid-template-columns:1fr}.nav nav{flex-wrap:wrap;justify-content:flex-start;gap:5px 12px}}

.cross-filters{grid-template-columns:repeat(2,minmax(0,240px))}
.cross-legend{display:flex;flex-wrap:wrap;gap:8px 18px;margin:15px 0 9px;color:var(--sub);font-size:.9rem}
.cross-legend i{display:inline-block;width:10px;height:10px;border-radius:3px;background:var(--dot);margin-right:6px}
.cross-chart-wrap{overflow:auto;border:1px solid var(--border);border-radius:12px}
.cross-chart{min-width:690px;background:#fff}
.cross-chart svg{display:block;width:100%;height:auto}
.election-type{display:inline-block;padding:2px 8px;border-radius:6px;font-weight:730;background:#f9e7f0;color:#8a2158}
.election-type.president{background:#e8eefb;color:#304e86}
#cross-table th:nth-child(2),#cross-table td:nth-child(2){text-align:left}
