/* 站台共用：基礎樣式、頁首、頁尾。首頁區塊在 home.css，內頁在 content.css。 */
:root { --navy: #091527; --ink: #13263d; --aqua: #59bdbd; --silver: #eef3f7; --line: #cdd8e0; --muted: #53687b; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--silver); color: var(--ink); font: 16px/1.7 'Noto Sans TC', 'Microsoft JhengHei', sans-serif; overflow-wrap: anywhere; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; color: inherit; }
img { max-width: 100%; display: block; height: auto; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: 'Noto Serif TC', 'PMingLiU', serif; font-weight: 900; line-height: 1.25; }
h2 { font-size: clamp(2.2rem, 4vw, 4rem); letter-spacing: .025em; }
h3 { font-size: 1.3rem; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--aqua); outline-offset: 3px; }
main:focus { outline: none; }
.wrap { width: min(1440px, 90%); margin: auto; }
.link-unavailable { opacity: .65; cursor: not-allowed; }
.skip { position: fixed; top: -80px; left: 20px; background: white; color: var(--ink); padding: 12px; z-index: 100; }
.skip:focus { top: 10px; }
.site-header { position: relative; z-index: 20; background: var(--navy); color: white; }
/* 桌機雙列：上列 Logo／功能列／搜尋，下列主選單；平板與手機改漢堡選單 */
.nav-inner { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "brand utility search" "nav nav nav"; align-items: center; column-gap: 20px; }
.brand { grid-area: brand; width: 265px; padding: 14px 0; }
.utility { grid-area: utility; justify-self: end; display: flex; gap: 24px; font-size: .875rem; }
.utility > * { display: inline-flex; align-items: center; min-height: 44px; }
.primary-nav { grid-area: nav; display: flex; flex-wrap: wrap; align-items: center; column-gap: 34px; border-top: 1px solid #ffffff1a; }
.nav-group { display: flex; align-items: center; position: relative; min-height: 56px; }
.nav-label, .nav-direct { font-size: 1rem; white-space: nowrap; }
a.nav-label:hover, a.nav-direct:hover { color: var(--aqua); }
.sub-toggle { border: 0; background: none; color: var(--aqua); min-width: 32px; min-height: 44px; padding: 8px 4px; }
.dropdown { position: absolute; top: 100%; left: 0; min-width: 230px; padding: 18px; display: none; gap: 8px; background: linear-gradient(180deg, rgba(61, 83, 105, .96), rgba(9, 21, 39, .96)); box-shadow: 0 20px 35px #0005; }
.dropdown.wide { width: 490px; grid-template-columns: 1fr 1fr; }
.dropdown > * { display: block; padding: 10px 14px; background: rgba(61, 83, 105, .5); font-size: 1rem; }
.dropdown a:hover { background: rgba(89, 189, 189, .5); }
html:not(.js) .nav-group:hover .dropdown, html:not(.js) .nav-group:focus-within .dropdown { display: grid; }
.js .nav-group:hover:not(.is-closed) .dropdown, .js .nav-group.open .dropdown { display: grid; }
.search-btn { grid-area: search; }
.menu-toggle { grid-area: toggle; }
.search-btn, .menu-toggle { border: 0; background: none; color: white; min-width: 44px; min-height: 44px; padding: 8px; }
.search-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.menu-toggle { display: none; }
.search-panel { padding: 24px 5%; background: #182b41; }
.search-panel > div { display: flex; max-width: 600px; }
.search-panel input[type=search] { min-width: 0; flex: 1; padding: 12px; border: 0; color: var(--ink); }
.search-panel button { background: var(--aqua); border: 0; padding: 10px 22px; color: #082238; }
.search-panel label { display: block; margin-bottom: 10px; }
.search-status { margin: 10px 0 0; min-height: 1.7em; }
.home-footer { background: #091527; color: #aebfcb; padding: 50px 0 20px; font-size: .875rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 35px; }
.footer-grid > * { min-width: 0; }
.footer-brand img { width: 270px; margin-bottom: 20px; }
.home-footer h3 { font-size: 1rem; color: white; }
.home-footer a, .home-footer .link-unavailable { display: flex; align-items: center; min-height: 44px; }
.footer-mark .english-logo { display: block; width: 210px; max-width: 100%; height: auto; filter: brightness(0) invert(1); opacity: .95; }
.copyright { border-top: 1px solid #ffffff20; margin-top: 30px; padding-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
@media (max-width: 1200px) {
  .primary-nav { column-gap: 22px; }
}

@media (max-width: 1000px) {
  .nav-inner { grid-template-columns: 1fr auto auto; grid-template-areas: "utility utility utility" "brand toggle search" "nav nav nav"; column-gap: 8px; }
  .utility { border-bottom: 1px solid #ffffff12; justify-self: stretch; justify-content: flex-end; }
  .brand { width: 210px; }
  .primary-nav { border-top: 0; }
  .js .primary-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #091527; max-height: 75vh; overflow: auto; padding: 20px 5%; }
  .js .primary-nav.open { display: block; }
  html:not(.js) .primary-nav { display: block; width: 100%; margin: 0; padding-bottom: 16px; }
  html:not(.js) .dropdown { display: grid; }
  .menu-toggle { display: flex; align-items: center; gap: 6px; }
  .menu-toggle span { display: none; }
  .menu-toggle b { font-size: 1rem; }
  .nav-group { min-height: 55px; flex-wrap: wrap; justify-content: space-between; }
  .nav-label, .nav-direct { font-size: 1rem; }
  .sub-toggle { padding: 12px 20px; }
  .dropdown, .dropdown.wide { position: static; width: 100%; flex-basis: 100%; grid-template-columns: 1fr; display: none; }
  /* 手機點擊後會留下 :hover，只在未開啟時取消停留展開，否則會蓋掉 .open */
  .js .nav-group:hover:not(.is-closed):not(.open) .dropdown { display: none; }
  .js .nav-group.open .dropdown { display: grid; }
  .nav-direct { display: block; padding: 16px 0; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .footer-mark { display: none; }
}

@media (max-width: 640px) {
  .utility { gap: 15px; font-size: .8rem; }
  .brand { width: 150px; padding: 12px 0; }
  h2 { font-size: 2.3rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-mark .english-logo { width: 180px; }
  .copyright { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *:before, *:after { animation: none !important; transition: none !important; }
}
