:root{--history-nav-h:62px;--history-ease:cubic-bezier(.16,1,.3,1)}
html{scroll-behavior:smooth}
.brand-site-footer{background:#0d0d0d;color:#8a857c;padding:clamp(40px,7vh,80px) clamp(18px,4vw,54px);display:flex;justify-content:space-between;align-items:flex-end;gap:24px;flex-wrap:wrap;border-top:1px solid #1c1a17}
.brand-site-footer__lockup{display:inline-flex;align-items:center;padding:10px 14px;background:#f4f1ea;border-radius:12px;box-shadow:inset 0 0 0 1px rgba(13,13,13,.12)}
.brand-site-footer__lockup img{display:block;width:clamp(230px,30vw,360px);max-width:100%;height:auto}
.brand-site-footer__meta{font-size:12px;letter-spacing:.1em;margin-top:10px;line-height:1.7}
.brand-site-footer__note{max-width:500px;font-family:'Noto Sans TC',sans-serif;font-weight:600;font-size:12px;line-height:1.7;text-align:right}
.brand-site-footer__note a{color:#f4f1ea}
html.history-transition-pending{background:#0d0d0d}
html.history-transition-pending body{visibility:hidden}
html.history-transition-pending .history-transition{visibility:visible}
@media(max-width:640px){.brand-site-footer{align-items:flex-start}.brand-site-footer__note{text-align:left}}
body{overflow-x:hidden}
body.history-product{background:#0d0d0d}
body.history-product .site-nav{height:var(--history-nav-h);padding:0 clamp(14px,3.5vw,44px);background:rgba(13,13,13,.82);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid #1c1a17;transition:background .28s ease,border-color .28s ease}
body.history-product .site-nav.nav-scrolled{background:rgba(13,13,13,.96);border-color:#2a2723}
body.history-product .brand{gap:10px;font:900 16px 'Archivo','Noto Sans TC',sans-serif;letter-spacing:-.02em;transition:opacity .2s ease}
body.history-product .brand:hover{color:#f4f1ea;opacity:.78}
body.history-product .brand-dot{width:11px;height:11px;border-radius:2px;box-shadow:0 0 0 0 rgba(228,2,43,.28);transition:transform .35s var(--history-ease),box-shadow .35s ease}
body.history-product .brand:hover .brand-dot{transform:rotate(12deg) scale(1.12);box-shadow:0 0 0 6px rgba(228,2,43,.12)}
body.history-product .nav-right{font:600 13px 'Archivo','Noto Sans TC',sans-serif;letter-spacing:.04em;gap:clamp(10px,2vw,26px)}
body.history-product .nav-right a{color:#b6afa4;transition:color .2s ease,opacity .2s ease}
body.history-product .nav-right a:hover,body.history-product .nav-right .on{color:#E4022B}
body.history-product .nav-right .history-support-link{display:inline-flex;align-items:center;padding:8px 16px;border-radius:999px;background:#E4022B;color:#fff;font-weight:800}
body.history-product .nav-right .history-support-link:hover{color:#fff;background:#ff173f}

.history-mobile-toggle,.history-mobile-menu{display:none}
.history-nav-title{display:none;color:#8f8880;font:800 11px 'Archivo','Noto Sans TC',sans-serif;letter-spacing:.04em;white-space:nowrap}
.history-mobile-toggle{width:40px;height:40px;place-items:center;flex:none;border:1px solid #33302b;border-radius:6px;background:#171512;color:#f4f1ea;cursor:pointer;transition:background .28s ease,border-color .28s ease,color .28s ease}
.history-mobile-toggle:focus-visible{outline:2px solid #E4022B;outline-offset:2px}
.history-mobile-toggle.open{background:#E4022B;border-color:#E4022B;color:#fff}
.history-ham{position:relative;display:block;width:20px;height:14px}
.history-ham i{position:absolute;left:0;right:0;height:2.4px;border-radius:2px;background:currentColor;transition:transform .36s cubic-bezier(.65,0,.35,1),opacity .2s ease}
.history-ham i:nth-child(1){top:0}.history-ham i:nth-child(2){top:50%;transform:translateY(-50%)}.history-ham i:nth-child(3){bottom:0}
.history-mobile-toggle.open .history-ham i:nth-child(1){top:50%;transform:translateY(-50%) rotate(45deg)}
.history-mobile-toggle.open .history-ham i:nth-child(2){opacity:0;transform:translateY(-50%) scaleX(.1)}
.history-mobile-toggle.open .history-ham i:nth-child(3){bottom:auto;top:50%;transform:translateY(-50%) rotate(-45deg)}
.history-mobile-menu{position:fixed;top:calc(var(--history-nav-h) + 8px);left:10px;right:10px;z-index:95;padding:8px;background:rgba(20,18,16,.98);border:1px solid #33302b;border-radius:14px;box-shadow:0 24px 70px rgba(0,0,0,.58);transform-origin:top;opacity:0;transform:translateY(-8px) scale(.98);pointer-events:none;transition:opacity .22s ease,transform .3s var(--history-ease)}
.history-mobile-menu.open{opacity:1;transform:none;pointer-events:auto}
.history-mobile-menu a{min-height:48px;display:flex;align-items:center;justify-content:space-between;padding:0 14px;border-radius:9px;color:#d9d3ca;font:800 14px 'Noto Sans TC',sans-serif}
.history-mobile-menu a:hover,.history-mobile-menu a:active{background:#2a1013;color:#fff}
.history-mobile-menu a.on{color:#ff6178}

.history-transition{position:fixed;inset:0;z-index:160;display:none;pointer-events:none;overflow:hidden}
.history-transition-cols{position:absolute;inset:0;display:flex}
.history-transition-cols span{flex:1;height:100%;background:#0d0d0d;will-change:transform}
.history-transition-cols span:nth-child(even){background:#131110}
.history-transition-center{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:clamp(28px,6vw,90px);color:#f4f1ea}
.history-transition-kicker{font:800 clamp(10px,1.2vw,13px)/1 'Archivo','Noto Sans TC',sans-serif;letter-spacing:.28em;color:#E4022B;margin-bottom:16px}
.history-transition-mask{overflow:hidden;padding-bottom:.12em}
.history-transition-title{font:900 clamp(42px,9.4vw,150px)/.9 'Noto Sans TC','Archivo',sans-serif;letter-spacing:-.035em;color:#f4f1ea;will-change:transform,opacity}
.history-transition-rule{height:3px;width:0;background:#E4022B;margin-top:clamp(16px,2.4vw,28px);will-change:width}

body.history-archive .hero{position:relative;overflow:hidden;padding:clamp(44px,7vw,92px) clamp(16px,4vw,48px) clamp(34px,5vw,58px);background:radial-gradient(100% 150% at 18% -24%,#291a1c 0%,#12100e 38%,#0d0d0d 72%)}
body.history-archive .hero:after{content:'';position:absolute;right:-12vw;bottom:-36%;width:min(54vw,760px);aspect-ratio:1;border:1px solid rgba(228,2,43,.13);border-radius:50%;box-shadow:0 0 0 11vw rgba(228,2,43,.018),0 0 0 22vw rgba(228,2,43,.012);pointer-events:none}
body.history-archive .hero-row{position:relative;z-index:1}
body.history-archive .hero h1{max-width:760px;text-wrap:balance}
body.history-archive .hero-copy{font-size:clamp(13px,1.25vw,15px);text-wrap:pretty}
body.history-archive .toolbar{top:var(--history-nav-h);padding-top:12px;padding-bottom:12px;background:linear-gradient(180deg,rgba(13,13,13,.98),rgba(13,13,13,.92));box-shadow:0 12px 26px rgba(0,0,0,.12)}
body.history-archive .years{scroll-snap-type:x proximity;padding:1px 1px 2px}
body.history-archive .year-btn{min-height:38px;scroll-snap-align:center;transition:transform .28s var(--history-ease),background .2s ease,border-color .2s ease,color .2s ease,box-shadow .2s ease}
body.history-archive .year-btn:hover{transform:translateY(-2px)}
body.history-archive .year-btn.on{box-shadow:0 8px 24px rgba(228,2,43,.22)}
body.history-archive .layout{align-items:stretch}
body.history-archive .map-panel{min-height:calc(100svh - 124px);isolation:isolate}
body.history-archive #map{filter:drop-shadow(0 24px 52px rgba(0,0,0,.22))}
body.history-archive .map-title{pointer-events:none}
body.history-archive .map-title strong{font-size:clamp(19px,2vw,24px)}
body.history-archive .county{transition:fill .32s ease,opacity .24s ease,stroke .24s ease,filter .24s ease}
body.history-archive .county:hover{filter:brightness(1.14) drop-shadow(0 7px 10px rgba(0,0,0,.18))}
body.history-archive .county.selected{filter:brightness(1.12) drop-shadow(0 10px 18px rgba(0,0,0,.3))}
body.history-archive .result-panel{position:relative;background:linear-gradient(180deg,#12100e 0%,#0f0e0c 100%)}
body.history-archive .candidate{transition:transform .32s var(--history-ease),border-color .22s ease,background .22s ease,box-shadow .22s ease}
body.history-archive .candidate:hover{transform:translateY(-3px);border-color:#4b443d;background:#191613;box-shadow:0 14px 30px rgba(0,0,0,.17)}
body.history-archive .bar>i{transform-origin:left;transition:width .7s var(--history-ease)}
body.history-archive .county-card{box-shadow:0 18px 46px rgba(0,0,0,.16)}
body.history-archive [data-history-town-drilldown]{min-height:44px;display:flex!important;align-items:center;justify-content:center;transition:transform .28s var(--history-ease),border-color .2s ease,color .2s ease,background .2s ease!important}
body.history-archive [data-history-town-drilldown]:hover{transform:translateY(-2px);background:#291417!important}

body.history-town .hero{position:relative;overflow:hidden;padding-top:clamp(34px,5vw,58px);padding-bottom:clamp(26px,4vw,42px);background:radial-gradient(90% 135% at 12% -18%,#281a1b 0%,#12100e 42%,#0d0d0d 74%)}
body.history-town .crumb a,body.history-town .back{transition:transform .28s var(--history-ease),color .2s ease,border-color .2s ease,background .2s ease}
body.history-town .back{min-height:40px;display:inline-flex;align-items:center}
body.history-town .back:hover{transform:translateX(-3px);background:#211a18;border-color:#E4022B}
body.history-town .map-panel{min-height:calc(100svh - 62px);isolation:isolate}
body.history-town #map{filter:drop-shadow(0 24px 52px rgba(0,0,0,.22))}
body.history-town .town{transition:filter .24s ease,stroke .24s ease,opacity .24s ease}
body.history-town .town:hover{filter:brightness(1.14) drop-shadow(0 6px 9px rgba(0,0,0,.16))}
body.history-town .side{background:linear-gradient(180deg,#12100e 0%,#0f0e0c 100%)}
body.history-town .county-summary{box-shadow:0 16px 42px rgba(0,0,0,.14)}
body.history-town .town-list{scrollbar-width:thin;scrollbar-color:#3b3530 transparent}
body.history-town .town-btn{min-height:42px;transition:transform .24s var(--history-ease),border-color .2s ease,color .2s ease,background .2s ease}
body.history-town .town-btn:hover{transform:translateY(-2px);background:#211916}
body.history-town .town-btn.on{background:#2a1013;box-shadow:inset 3px 0 0 #E4022B}
body.history-town .candidate{transition:background .2s ease,padding .24s var(--history-ease)}
body.history-town .candidate:hover{background:#171311;padding-left:8px;padding-right:8px}

.history-focus-ring:focus-visible,body.history-product button:focus-visible,body.history-product a:focus-visible{outline:2px solid #f6c945;outline-offset:3px}
@media (hover:none){body.history-product .county:hover,body.history-product .town:hover{filter:none}body.history-product .candidate:hover,body.history-product .town-btn:hover{transform:none}}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}.history-transition{display:none!important}}

@media(max-width:900px){
  body.history-archive .map-panel,body.history-town .map-panel{min-height:560px}
  body.history-archive .result-panel,body.history-town .side{padding-bottom:max(58px,env(safe-area-inset-bottom))}
}
@media(max-width:660px){
  :root{--history-nav-h:56px}
  body.history-product .site-nav{height:56px;padding:8px 12px;gap:8px}
  body.history-product .brand{font-size:15px;white-space:nowrap;min-width:0}
  body.history-product .nav-right{display:none!important}
  .history-nav-title{display:block;min-width:0;margin-left:auto;overflow:hidden;text-overflow:ellipsis;color:#aaa39a;text-align:right}
  .history-mobile-toggle{display:grid;margin-left:8px}
  .history-mobile-menu{display:block}
  .history-transition-center{padding:34px 20px}.history-transition-title{font-size:clamp(40px,15vw,72px);line-height:.94}.history-transition-kicker{font-size:10px;letter-spacing:.2em}
  body.history-archive .hero{padding:34px 16px 28px}
  body.history-archive .hero-row{display:block}
  body.history-archive .hero h1{font-size:clamp(46px,14vw,64px);line-height:.9}
  body.history-archive .hero-copy{margin-top:24px;font-size:13px;line-height:1.72;max-width:92%}
  body.history-archive .toolbar{top:56px;padding:10px 0 10px 12px;overflow:hidden}
  body.history-archive .toolbar-row{gap:0}
  body.history-archive .type-pill{display:none}
  body.history-archive .years{gap:7px;padding-right:20px;overflow-x:auto;-webkit-overflow-scrolling:touch;scroll-padding:0 18px}
  body.history-archive .year-btn{min-height:40px;padding:9px 14px;font-size:13px}
  body.history-archive .layout{display:block}
  body.history-archive .map-panel{min-height:clamp(430px,58svh,540px);border-right:0;border-bottom:1px solid #1c1a17}
  body.history-archive #map{inset:70px 4px 74px}
  body.history-archive .map-title{top:22px;left:16px;right:16px}
  body.history-archive .map-status{left:16px;right:16px;bottom:16px;font-size:11px;line-height:1.55}
  body.history-archive .result-panel{padding:28px 16px max(64px,env(safe-area-inset-bottom))}
  body.history-archive .election-meta{gap:12px;padding-bottom:20px}
  body.history-archive #election-title{font-size:26px}
  body.history-archive .candidate{padding:15px 14px;border-radius:14px}
  body.history-archive .cand-head{align-items:flex-start}
  body.history-archive .cand-name{font-size:16px;line-height:1.4}
  body.history-archive .cand-votes{font-size:16px;padding-top:3px}
  body.history-archive .county-card{border-radius:14px}
  body.history-archive .county-row{grid-template-columns:minmax(0,1fr) auto;gap:7px 10px}
  body.history-archive .county-row-share{grid-column:2;min-width:0}.county-row-votes{grid-column:2}
  body.history-archive [data-history-town-drilldown]{min-height:48px;margin:12px 12px 14px!important}
  body.history-product .tooltip{display:none!important}

  body.history-town .hero{padding:26px 16px 24px}
  body.history-town .crumb{overflow:auto;white-space:nowrap;scrollbar-width:none}
  body.history-town .kicker{margin-top:18px}
  body.history-town .hero h1{font-size:clamp(38px,12vw,54px);line-height:.92}
  body.history-town .hero p{font-size:12px;line-height:1.65}
  body.history-town .layout{display:block}
  body.history-town .map-panel{min-height:clamp(440px,60svh,560px);border-right:0;border-bottom:1px solid #1c1a17}
  body.history-town #map{inset:84px 2px 40px}
  body.history-town .map-head{top:18px;left:16px;right:16px;align-items:flex-start}
  body.history-town .map-head strong{font-size:18px}
  body.history-town .back{min-height:42px;padding:8px 11px;white-space:nowrap}
  body.history-town .side{padding:28px 16px max(64px,env(safe-area-inset-bottom))}
  body.history-town .side h2{font-size:28px}
  body.history-town .town-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:none}
  body.history-town .town-btn{min-height:46px;padding:10px 11px;font-size:12px}
  body.history-town .candidate{padding:12px 0}
}
@media(max-width:380px){body.history-town .map-head{gap:8px}.history-mobile-menu{left:8px;right:8px}body.history-archive .hero h1{font-size:44px}body.history-town .town-list{grid-template-columns:1fr 1fr}}
