
:root{
  --brand:#00843D; --brand-deep:#0B5B33; --brand-dark:#0A3D28;
  --hero1:#0A3D28; --hero2:#0F6B42; --lime:#C3DA45; --accent:#14937E;
  --ink:#233028; --ink2:#5A6B60; --paper:#FFFFFF; --mist:#F3F7F3; --line:#D9E5DB;
  --en-display:inline;
}
html{scroll-behavior:smooth}
body{margin:0;font-family:'Noto Sans TC',system-ui,sans-serif;color:var(--ink);background:var(--paper);-webkit-font-smoothing:antialiased}
a{color:var(--brand);text-decoration:none}
a:hover{color:var(--brand-deep)}
@keyframes pulseDot{0%,100%{transform:scale(1);opacity:.9}50%{transform:scale(1.35);opacity:.5}}

/* Responsive layout */
*,*::before,*::after{box-sizing:border-box}
html{scroll-padding-top:88px}
body{overflow-x:hidden}
img{max-width:100%}
.site-shell{min-width:0!important;width:100%}
.mobile-menu-button{display:none;margin-left:auto;width:44px;height:44px;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--brand-dark);cursor:pointer;flex:none}
.mobile-menu-button span{display:block;width:22px;height:2px;margin:4px auto;border-radius:2px;background:currentColor;transition:transform .2s ease,opacity .2s ease}
.mobile-menu-button[aria-expanded="true"] span:nth-child(1){transform:translateY(6px) rotate(45deg)}
.mobile-menu-button[aria-expanded="true"] span:nth-child(2){opacity:0}
.mobile-menu-button[aria-expanded="true"] span:nth-child(3){transform:translateY(-6px) rotate(-45deg)}
.desktop-font-controls{display:flex;gap:8px;align-items:center}
.font-size-choice{display:inline-flex;min-width:24px;min-height:24px;align-items:center;justify-content:center;border:0;border-radius:5px;padding:0 5px!important;background:transparent;font:inherit;cursor:pointer;color:rgba(255,255,255,.85)!important;text-decoration:none;transition:background-color .2s ease,color .2s ease}
.font-size-choice:hover,.font-size-choice:focus-visible{background:rgba(255,255,255,.16);color:#fff!important;outline:2px solid transparent}
.font-size-choice.is-active{background:var(--lime)!important;color:var(--brand-dark)!important;font-weight:700}
.mobile-font-controls{display:none}
.mobile-utility-links{display:none}
.utility-link-disabled{cursor:not-allowed;opacity:.72}
.primary-navigation{position:relative;z-index:2;pointer-events:auto}
.primary-navigation>a{position:relative;white-space:nowrap;pointer-events:auto;cursor:pointer}
.primary-navigation>a:not(:last-child)::after{content:"";position:absolute;left:12px;right:12px;bottom:2px;height:3px;border-radius:999px;background:var(--brand);transform:scaleX(0);transform-origin:center;transition:transform .22s ease}
.primary-navigation>a:not(:last-child):hover::after,.primary-navigation>a.nav-active:not(:last-child)::after{transform:scaleX(1)}
.primary-navigation>a.nav-active:not(:last-child){background:transparent!important;color:var(--brand-deep)!important;font-weight:700}
.primary-navigation>a.nav-active:last-child{box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 24%,transparent)}
.hero-pattern{opacity:.08!important}
.surface-card{border-radius:16px!important;border-color:var(--line)!important;box-shadow:0 4px 16px rgba(10,61,40,.07)!important;transition:transform .22s ease,border-color .22s ease,box-shadow .22s ease}
.dark-card{border-radius:16px!important;transition:transform .22s ease,border-color .22s ease,background-color .22s ease}

section#duty,section#ai{position:relative;background:#F5F8F4;box-shadow:0 0 0 100vmax #F5F8F4;clip-path:inset(0 -100vmax)}
section[id]:not(#top) h2,footer#contact h2{position:relative;padding-bottom:12px;margin-bottom:22px!important}
section[id]:not(#top) h2::after,footer#contact h2::after{content:"";position:absolute;left:0;bottom:0;width:44px;height:3px;border-radius:999px;background:linear-gradient(90deg,var(--brand),var(--lime))}
section#security h2::after{background:linear-gradient(90deg,var(--lime),rgba(195,218,69,.25))}

.light-smart-section{background:linear-gradient(145deg,#F4F8F4 0%,#E8F3EA 100%)!important;color:var(--ink)!important;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.light-smart-section h2{color:var(--brand-dark)!important}
.light-smart-section p{color:var(--ink2)!important}
.light-smart-section [style*="color:var(--lime)"]{color:var(--brand-deep)!important}
.light-smart-section .smart-line-card,.light-smart-section .smart-feature-card{background:#fff!important;border-color:var(--line)!important;backdrop-filter:none!important}
.light-smart-section .smart-line-card>div>div:first-child{color:var(--brand-dark)!important}
.light-smart-section .smart-line-card>div>div:last-child{color:var(--ink2)!important}
.light-smart-section .smart-feature-card>div:first-child{color:var(--brand-deep)!important}
.light-smart-section .smart-feature-card>div:last-child{color:var(--ink2)!important}

.carousel-caption{position:absolute;left:0;right:0;bottom:0;z-index:3;padding:72px 28px 24px;background:linear-gradient(transparent,rgba(7,45,30,.86));color:#fff;display:flex;align-items:flex-end;justify-content:space-between;gap:18px;pointer-events:none}
.carousel-caption span{font-size:12px;font-weight:700;letter-spacing:2px;color:var(--lime);text-transform:uppercase}
.carousel-caption strong{font-family:'Noto Serif TC',serif;font-size:22px;letter-spacing:1px;text-shadow:0 2px 8px rgba(0,0,0,.35)}

@media (hover:hover){
  .surface-card:hover{transform:translateY(-3px);border-color:color-mix(in srgb,var(--brand) 45%,var(--line))!important;box-shadow:0 12px 28px rgba(10,61,40,.12)!important}
  .dark-card:hover{transform:translateY(-3px);border-color:var(--lime)!important;background:rgba(255,255,255,.12)!important}
}
html[data-font-size="large"] .site-header-row{max-width:1500px!important;gap:16px!important}
html[data-font-size="large"] .site-header-row>a>span>span:last-child{display:none!important}
html[data-font-size="large"] .primary-navigation>a{padding-left:9px!important;padding-right:9px!important}
html[data-font-size="large"] .primary-navigation>a:last-child{padding-left:16px!important;padding-right:16px!important}

@media (max-width:1100px){
  .site-header-row{gap:14px!important}
  .primary-navigation{font-size:13px!important}
  .primary-navigation a{padding-left:8px!important;padding-right:8px!important}
}

@media (max-width:1450px){
  html[data-font-size="large"] .site-header-row{position:relative;padding:10px 20px!important}
  html[data-font-size="large"] .site-header-row>a{min-width:0;flex:1}
  html[data-font-size="large"] .site-header-row>a>span{min-width:0}
  html[data-font-size="large"] .site-header-row>a>span>span:first-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html[data-font-size="large"] .mobile-menu-button{display:block}
  html[data-font-size="large"] .primary-navigation{display:none!important;position:absolute;top:100%;left:12px;right:12px;margin:0!important;padding:10px;background:#fff;border:1px solid var(--line);border-radius:0 0 14px 14px;box-shadow:0 12px 24px rgba(10,56,51,.16);max-height:calc(100vh - 76px);overflow-y:auto;flex-direction:column;gap:2px!important}
  html[data-font-size="large"] .primary-navigation.is-open{display:flex!important}
  html[data-font-size="large"] .primary-navigation>a{display:block;padding:12px 14px!important;border-radius:8px;text-align:left;white-space:normal}
  html[data-font-size="large"] .primary-navigation>a::after{display:none}
  html[data-font-size="large"] .primary-navigation>a.nav-active:not(:last-child){background:var(--mist)!important}
  html[data-font-size="large"] .primary-navigation> a:last-child{margin-top:4px;text-align:center}
  html[data-font-size="large"] .mobile-font-controls{display:flex;align-items:center;gap:8px;padding:8px 10px 12px;margin-bottom:4px;border-bottom:1px solid var(--line);color:var(--ink2)}
  html[data-font-size="large"] .mobile-font-controls>span{margin-right:auto;font-weight:700;color:var(--brand-dark)}
  html[data-font-size="large"] .mobile-font-controls button{width:38px;height:34px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--brand-dark);font:inherit;font-weight:700;cursor:pointer}
  html[data-font-size="large"] .mobile-font-controls button.is-active{border-color:var(--brand);background:var(--brand);color:#fff}
  html[data-font-size="large"] .mobile-utility-links{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:4px 0 10px;margin-bottom:4px;border-bottom:1px solid var(--line)}
  html[data-font-size="large"] .mobile-utility-links a,
  html[data-font-size="large"] .mobile-utility-links .utility-link-disabled{padding:9px 10px!important;background:var(--mist);border:1px solid var(--line);text-align:center;color:var(--brand-deep)!important;font-weight:700}
}

@media (max-width:900px){
  html{scroll-padding-top:76px}
  body.menu-open{overflow:hidden}
  .top-utility-bar{display:none!important}
  .site-header-row{padding:10px 20px!important;position:relative}
  .site-header-row>a{min-width:0;flex:1}
  .site-header-row>a img{width:40px!important;height:40px!important}
  .site-header-row>a>span{min-width:0}
  .site-header-row>a>span>span:first-child{font-size:17px!important;letter-spacing:1px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .site-header-row>a>span>span:last-child{display:none!important}
  .mobile-menu-button{display:block}
  .primary-navigation{display:none!important;position:absolute;top:100%;left:12px;right:12px;margin:0!important;padding:10px;background:#fff;border:1px solid var(--line);border-radius:0 0 14px 14px;box-shadow:0 12px 24px rgba(10,56,51,.16);max-height:calc(100vh - 76px);overflow-y:auto;flex-direction:column;gap:2px!important}
  .primary-navigation.is-open{display:flex!important}
  .primary-navigation a{display:block;padding:12px 14px!important;border-radius:8px;font-size:15px}
  .primary-navigation>a::after{display:none}
  .primary-navigation>a.nav-active:not(:last-child){background:var(--mist)!important}
  .primary-navigation> a:last-child{margin-top:4px;text-align:center}
  .mobile-font-controls{display:flex;align-items:center;gap:8px;padding:8px 10px 12px;margin-bottom:4px;border-bottom:1px solid var(--line);color:var(--ink2);font-size:14px}
  .mobile-font-controls>span{margin-right:auto;font-weight:700;color:var(--brand-dark)}
  .mobile-font-controls button{width:38px;height:34px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--brand-dark);font:inherit;font-weight:700;cursor:pointer}
  .mobile-font-controls button:hover,.mobile-font-controls button:focus-visible{border-color:var(--brand);outline:2px solid var(--brand);outline-offset:1px}
  .mobile-font-controls button.is-active{border-color:var(--brand);background:var(--brand);color:#fff}
  .mobile-utility-links{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:4px 0 10px;margin-bottom:4px;border-bottom:1px solid var(--line)}
  .mobile-utility-links a,
  .mobile-utility-links .utility-link-disabled{padding:9px 10px!important;background:var(--mist);border:1px solid var(--line);text-align:center;color:var(--brand-deep)!important;font-size:13px!important;font-weight:700}

  section>div[style*="grid-template-columns"],
  footer>div[style*="grid-template-columns"]{grid-template-columns:1fr!important;gap:28px!important}
  [style*="grid-template-columns:repeat(6"],
  [style*="grid-template-columns:repeat(5"],
  [style*="grid-template-columns:repeat(4"],
  [style*="grid-template-columns:repeat(3"]{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  [style*="grid-column:span"]{grid-column:auto!important}
  [data-activity-carousel]{height:clamp(260px,55vw,430px)!important}
}

@media (max-width:600px){
  :root{--en-display:none}
  body{font-size:15px}
  .site-header-row{padding:9px 16px!important}
  .site-header-row>a{gap:9px!important}
  .site-header-row>a img{width:36px!important;height:36px!important}
  .site-header-row>a>span>span:first-child{font-size:15px!important}

  section>div,footer>div{padding-left:18px!important;padding-right:18px!important}
  section[id]{scroll-margin-top:68px}
  section[id]>div[style*="padding:72px"],
  section[id][style*="padding:72px"],
  section[id][style*="padding:76px"],
  section[id][style*="padding:64px"]{padding-top:48px!important;padding-bottom:32px!important}

  [style*="grid-template-columns"]{grid-template-columns:1fr!important}
  [style*="grid-column:span"]{grid-column:auto!important}
  [style*="font-size:58px"]{font-size:38px!important;letter-spacing:3px!important}
  h2,[style*="font-size:34px"]{font-size:27px!important;letter-spacing:1.5px!important}
  [style*="font-size:28px"][style*="white-space:nowrap"],
  [style*="font-size:26px"][style*="white-space:nowrap"]{font-size:21px!important;white-space:normal!important}
  [style*="padding:72px 32px 64px"]{padding-top:46px!important;padding-bottom:42px!important}
  [style*="padding:20px 32px"][style*="grid-template-columns:repeat(4"]{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:18px 10px!important}
  [data-activity-carousel]{height:230px!important;border-radius:12px!important}

  .hero-layout{padding:32px 18px 26px!important;gap:22px!important}
  .hero-heading{margin:14px 0 8px!important}
  .hero-en{display:none!important}
  .hero-copy{line-height:1.75!important}
  .hero-mark{gap:8px!important}
  .hero-mark-image{max-width:280px!important}
  .hero-mark-caption{letter-spacing:2px!important}
  .hero-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:0!important;padding:10px 12px!important}
  .hero-stat{min-height:102px;padding:14px 6px;display:flex;flex-direction:column;align-items:center;justify-content:center}
  .hero-stat:nth-child(odd){border-right:1px solid rgba(255,255,255,.12)}
  .hero-stat:nth-child(n+3){border-top:1px solid rgba(255,255,255,.12)}
  .hero-stat-value{height:auto!important;min-height:34px;font-size:22px!important;line-height:1.25!important;white-space:normal!important}
  .hero-stat-label{font-size:12.5px!important;line-height:1.45!important;margin-top:4px}
  .carousel-caption{padding:48px 18px 16px;flex-direction:column;align-items:flex-start;gap:4px}
  .carousel-caption strong{font-size:17px}

  section#about>div[style*="grid-template-columns:300px"]{gap:24px!important}
  section#about img[style*="height:330px"]{height:auto!important;max-height:420px;object-position:top}
  section#org div[style*="grid-template-columns:280px"]{display:block!important}
  section#org div[style*="grid-template-columns:280px"]>div{padding:12px 16px!important;border-left:0!important}
  section#org div[style*="grid-template-columns:280px"]>div+div{padding-top:0!important}
  footer div[style*="grid-template-columns:1fr 1fr"]{grid-template-columns:1fr!important}
  footer div[style*="justify-content:space-between"]{align-items:flex-start!important;gap:12px;flex-direction:column}
}

/* Comfortable compact density for desktop screens */
@media (min-width:901px){
  .site-header-row{padding:10px 32px!important}
  .site-header-row>a img{width:42px!important;height:42px!important}
  .hero-layout{padding:48px 32px 42px!important;gap:40px!important}
  .hero-copy{line-height:1.8!important}
  .hero-mark-image{max-width:380px!important}
  .hero-stats{padding:13px 32px!important;gap:20px!important}

  [data-screen-label="部門活動輪播"]>div{padding:30px 32px 28px!important}
  [data-activity-carousel]{height:500px!important}

  section#about{padding:52px 32px 24px!important}
  section#duty{padding:48px 32px 24px!important}
  section#org{margin-top:44px!important}
  section#org>div{padding:48px 32px!important}
  section#pillars{padding:50px 32px 30px!important}
  section#smart{margin-top:28px!important}
  section#smart>div{padding:52px 32px!important;gap:44px!important}
  section#ai{padding:52px 32px 30px!important}
  section#security{margin-top:28px!important}
  section#security>div{padding:52px 32px!important}
  footer#contact>div:first-child{padding:44px 32px 32px!important}

  html[data-font-size="large"] .hero-layout{padding:56px 32px 48px!important}
  html[data-font-size="large"] .hero-stats{padding-top:16px!important;padding-bottom:16px!important}
  html[data-font-size="large"] [data-screen-label="部門活動輪播"]>div{padding-top:36px!important;padding-bottom:32px!important}
  html[data-font-size="large"] [data-activity-carousel]{height:500px!important}
  html[data-font-size="large"] section#about,
  html[data-font-size="large"] section#duty,
  html[data-font-size="large"] section#pillars,
  html[data-font-size="large"] section#ai{padding-top:58px!important}
  html[data-font-size="large"] section#org>div,
  html[data-font-size="large"] section#smart>div,
  html[data-font-size="large"] section#security>div{padding-top:58px!important;padding-bottom:58px!important}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}
