/* WT_HEADER1031 全站統一刊頭樣式（Gemini 4 Argon 設計稿 2026-10-31，Claude 整合） */
/* ===== 全站統一刊頭（wth- 獨立命名空間，防 Bootstrap 3 汙染） ===== */
header.wth {
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
  height: 56px;
  background-color: #262626;
  border-bottom: 1px solid #C9962F;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.38);
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
  box-sizing: border-box;
}

/* 嚴格重設內部元素，防止舊站全域或 Bootstrap 3 樣式干擾 */
header.wth *,
header.wth *::before,
header.wth *::after {
  box-sizing: border-box;
}
header.wth ul,
header.wth li,
header.wth p,
header.wth span,
header.wth div {
  margin: 0;
  padding: 0;
  list-style: none;
  line-height: 1.4;
}
header.wth a {
  margin: 0;
  padding: 0;
  text-decoration: none;
  background: transparent;
  color: #EDEDED;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
header.wth button {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
header.wth img,
header.wth svg {
  display: block;
}

/* 刊頭內層容器 */
header.wth .wth-inner {
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Logo 區塊 */
header.wth .wth-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 4px 0;
  border-radius: 4px;
}
header.wth .wth-logo:focus-visible {
  outline: 2px solid #FCF6BA;
  outline-offset: 2px;
}
header.wth .wth-logo-img {
  height: 32px;
  width: auto;
  aspect-ratio: 558 / 105;
  object-fit: contain;
}

/* 漢堡按鈕（<1100px 顯示） */
header.wth .wth-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  color: #EDEDED;
  border: 1px solid rgba(201, 150, 47, 0.35);
  background-color: rgba(255, 255, 255, 0.03);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
header.wth .wth-burger:hover {
  color: #FCF6BA;
  border-color: #C9962F;
  background-color: rgba(201, 150, 47, 0.14);
}
header.wth .wth-burger:focus-visible {
  outline: 2px solid #FCF6BA;
  outline-offset: -2px;
}
header.wth .wth-burger-icon {
  width: 24px;
  height: 24px;
}
header.wth .wth-icon-close {
  display: none;
}
header.wth.wth-open .wth-icon-bars {
  display: none;
}
header.wth.wth-open .wth-icon-close {
  display: block;
}

/* 手機抽屜遮罩 */
header.wth .wth-backdrop {
  position: fixed;
  inset: 56px 0 0 0;
  background-color: rgba(10, 18, 28, 0.72);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 9990;
}
header.wth.wth-open .wth-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 導覽箭頭 SVG */
header.wth .wth-caret {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

/* ===== 平板與手機抽屜樣式（<1100px） ===== */
@media (max-width: 1099.98px) {
  header.wth .wth-nav {
    position: fixed;
    top: 56px;
    right: 0;
    bottom: 0;
    width: min(380px, 88vw);
    background-color: #232323;
    border-left: 1px solid rgba(201, 150, 47, 0.35);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s;
    z-index: 9995;
    padding: 12px 0 36px;
  }
  header.wth.wth-open .wth-nav {
    transform: translateX(0);
    visibility: visible;
  }
  header.wth .wth-menu {
    display: flex;
    flex-direction: column;
  }
  header.wth .wth-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }
  header.wth .wth-item-row {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
  }
  header.wth .wth-link {
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #EDEDED;
    border-left: 4px solid transparent;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  }
  header.wth .wth-link:hover {
    color: #FCF6BA;
    background-color: rgba(201, 150, 47, 0.14);
    border-left-color: #C9962F;
  }
  header.wth .wth-link:focus-visible {
    outline: 2px solid #FCF6BA;
    outline-offset: -2px;
    color: #FCF6BA;
  }
  /* 目前頁與父層啟用狀態（手機抽屜） */
  header.wth .wth-item.is-active > .wth-item-row > .wth-link {
    color: #FCF6BA;
    border-left-color: #D88A2C;
    background-color: rgba(216, 138, 44, 0.14);
  }
  header.wth a[aria-current="page"] {
    color: #FCF6BA !important;
    font-weight: 700;
    background: linear-gradient(90deg, rgba(216, 138, 44, 0.28) 0%, rgba(201, 150, 47, 0.08) 100%) !important;
    border-left: 4px solid #D88A2C !important;
  }

  /* 手機端右側子選單展開鈕（>=48x48px） */
  header.wth .wth-sub-toggle {
    width: 52px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #C9962F;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    background-color: rgba(255, 255, 255, 0.02);
  }
  header.wth .wth-sub-toggle:hover {
    color: #FCF6BA;
    background-color: rgba(201, 150, 47, 0.18);
  }
  header.wth .wth-sub-toggle:focus-visible {
    outline: 2px solid #FCF6BA;
    outline-offset: -2px;
  }
  header.wth .wth-has-sub.wth-sub-open > .wth-item-row > .wth-sub-toggle .wth-caret {
    transform: rotate(180deg);
    color: #FCF6BA;
  }

  /* 手機端子選單與大選單面板（預設收合，點展開鈕開啟，不使用 display:none!important） */
  header.wth .wth-dropdown,
  header.wth .wth-mega {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
    background-color: #16283F;
    transition: max-height 0.3s ease, opacity 0.25s ease, visibility 0.25s;
  }
  header.wth .wth-has-sub.wth-sub-open > .wth-dropdown,
  header.wth .wth-has-sub.wth-sub-open > .wth-mega {
    max-height: 1600px;
    opacity: 1;
    visibility: visible;
    border-top: 1px solid rgba(201, 150, 47, 0.3);
  }
  header.wth .wth-mega-grid {
    padding: 12px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  header.wth .wth-mega-title {
    font-size: 13px;
    font-weight: 700;
    color: #FCF6BA;
    letter-spacing: 0.06em;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(201, 150, 47, 0.35);
    margin-bottom: 4px;
  }
  header.wth .wth-sub-list {
    display: flex;
    flex-direction: column;
  }
  header.wth .wth-sub-link {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #EDEDED;
    border-left: 3px solid transparent;
  }
  header.wth .wth-mega .wth-sub-link {
    padding: 10px 12px;
  }
  header.wth .wth-sub-link:hover {
    color: #FCF6BA;
    background-color: rgba(201, 150, 47, 0.16);
    border-left-color: #C9962F;
  }
  header.wth .wth-sub-link:focus-visible {
    outline: 2px solid #FCF6BA;
    outline-offset: -2px;
  }
  header.wth .wth-mega-footer {
    padding: 8px 16px 14px;
    border-top: 1px solid rgba(201, 150, 47, 0.25);
  }
  header.wth .wth-mega-all {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    color: #FCF6BA;
    background-color: rgba(216, 138, 44, 0.2);
    border: 1px solid rgba(201, 150, 47, 0.5);
    border-radius: 6px;
  }
  header.wth .wth-mega-all:hover {
    background-color: rgba(216, 138, 44, 0.35);
  }

  /* 手機抽屜內 CTA「聯繫我們」 */
  header.wth .wth-item-cta {
    padding: 16px 18px 8px;
    border-bottom: none;
  }
  header.wth .wth-link-cta {
    justify-content: center;
    min-height: 48px;
    border-radius: 6px;
    border-left: none !important;
    background: linear-gradient(135deg, #D88A2C 0%, #C9962F 100%);
    color: #1A1A1A !important;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 3px 10px rgba(216, 138, 44, 0.3);
  }
  header.wth .wth-link-cta:hover {
    background: linear-gradient(135deg, #FCF6BA 0%, #D88A2C 100%);
    color: #16283F !important;
  }
}

/* ===== 桌機版樣式（>=1100px 單列不換行） ===== */
@media (min-width: 1100px) {
  header.wth {
    height: 64px;
  }
  header.wth .wth-inner {
    padding: 0 20px;
  }
  header.wth .wth-logo-img {
    height: 40px;
  }
  header.wth .wth-burger,
  header.wth .wth-backdrop {
    display: none;
  }
  header.wth .wth-nav {
    height: 100%;
    display: flex;
    align-items: center;
  }
  header.wth .wth-menu {
    height: 100%;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
    gap: 2px;
  }
  header.wth .wth-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
  }
  header.wth .wth-item-row {
    height: 100%;
    display: flex;
    align-items: center;
  }

  /* 狀態 1：一般狀態（Default） */
  header.wth .wth-link {
    height: 100%;
    display: inline-flex;
    align-items: center;
    padding: 0 11px;
    font-size: 15px;
    font-weight: 600;
    color: #EDEDED;
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
  }
  header.wth .wth-has-sub > .wth-item-row > .wth-link {
    padding-right: 4px;
  }

  /* 桌機下拉箭頭按鈕（與父連結無縫整合） */
  header.wth .wth-sub-toggle {
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px 0 2px;
    color: #C9962F;
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
  }

  /* 狀態 2：Hover 懸停狀態（淡金字 #FCF6BA + 14% 微光金底 + 2px 經典金 #C9962F 底線） */
  header.wth .wth-item:not(.wth-item-cta):hover > .wth-item-row > .wth-link,
  header.wth .wth-item:not(.wth-item-cta):hover > .wth-item-row > .wth-sub-toggle {
    color: #FCF6BA;
    background-color: rgba(201, 150, 47, 0.14);
    border-bottom-color: #C9962F;
  }
  header.wth .wth-has-sub:hover > .wth-item-row > .wth-sub-toggle .wth-caret,
  header.wth .wth-has-sub:focus-within > .wth-item-row > .wth-sub-toggle .wth-caret,
  header.wth .wth-has-sub.wth-sub-open > .wth-item-row > .wth-sub-toggle .wth-caret {
    transform: rotate(180deg);
    color: #FCF6BA;
  }

  /* 狀態 3：Focus-visible 鍵盤聚焦狀態 */
  header.wth .wth-link:focus-visible,
  header.wth .wth-sub-toggle:focus-visible,
  header.wth .wth-sub-link:focus-visible,
  header.wth .wth-mega-all:focus-visible {
    outline: 2px solid #FCF6BA;
    outline-offset: -2px;
    color: #FCF6BA;
  }

  /* 狀態 5：父層選單 is-active 狀態 */
  header.wth .wth-item.is-active > .wth-item-row > .wth-link,
  header.wth .wth-item.is-active > .wth-item-row > .wth-sub-toggle {
    color: #FCF6BA;
    border-bottom-color: #D88A2C;
    background-color: rgba(216, 138, 44, 0.18);
  }

  /* 狀態 4：目前頁 [aria-current="page"] 狀態（與 hover 一眼可分：暖金漸層底 + 頂部金線點綴 + 底部 3px 亮橘金實線 + 粗體淡金字） */
  header.wth .wth-item > .wth-item-row > a[aria-current="page"] {
    color: #FCF6BA;
    font-weight: 700;
    background: linear-gradient(180deg, rgba(216, 138, 44, 0.28) 0%, rgba(216, 138, 44, 0.12) 100%);
    border-top-color: #FCF6BA;
    border-bottom-color: #D88A2C;
  }
  header.wth .wth-item.is-active > .wth-item-row > a[aria-current="page"] + .wth-sub-toggle {
    background: linear-gradient(180deg, rgba(216, 138, 44, 0.28) 0%, rgba(216, 138, 44, 0.12) 100%);
    border-top-color: #FCF6BA;
    border-bottom-color: #D88A2C;
    color: #FCF6BA;
  }

  /* 狀態 6：CTA「聯繫我們」按鈕狀態 */
  header.wth .wth-item-cta {
    margin-left: 8px;
  }
  header.wth .wth-link-cta {
    height: 38px !important;
    padding: 0 15px !important;
    border-radius: 6px;
    border: 1px solid #FCF6BA !important;
    background: linear-gradient(135deg, #D88A2C 0%, #C9962F 100%);
    color: #1A1A1A !important;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(216, 138, 44, 0.32);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  }
  header.wth .wth-link-cta:hover {
    background: linear-gradient(135deg, #FCF6BA 0%, #D88A2C 100%) !important;
    color: #16283F !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(252, 246, 186, 0.45);
  }
  header.wth .wth-link-cta:focus-visible {
    outline: 2px solid #FCF6BA !important;
    outline-offset: 2px !important;
  }

  /* 桌機小下拉與大選單面板（深海軍藍 #16283F 實心底，絕不透出下方淺灰麵包屑） */
  header.wth .wth-dropdown,
  header.wth .wth-mega {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #16283F;
    border: 1px solid rgba(201, 150, 47, 0.45);
    border-top: 2px solid #D88A2C;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 10000;
  }
  header.wth .wth-dropdown {
    min-width: 210px;
    padding: 8px 0;
  }
  header.wth .wth-mega {
    width: 720px;
    left: -40px;
    padding: 20px 24px 16px;
  }

  /* CSS :hover / :focus-within / .wth-sub-open 展開下拉 */
  header.wth .wth-has-sub:hover > .wth-dropdown,
  header.wth .wth-has-sub:focus-within > .wth-dropdown,
  header.wth .wth-has-sub.wth-sub-open > .wth-dropdown,
  header.wth .wth-has-sub:hover > .wth-mega,
  header.wth .wth-has-sub:focus-within > .wth-mega,
  header.wth .wth-has-sub.wth-sub-open > .wth-mega {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  /* 大選單三欄結構 */
  header.wth .wth-mega-grid {
    display: grid;
    grid-template-columns: 1.9fr 1fr 1.1fr;
    gap: 24px;
  }
  header.wth .wth-mega-title {
    font-size: 13px;
    font-weight: 700;
    color: #FCF6BA;
    letter-spacing: 0.08em;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(201, 150, 47, 0.4);
  }
  /* 依地區 11 筆連結排成雙欄，避免面板過長 */
  header.wth .wth-sub-list-region {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 12px;
  }
  header.wth .wth-sub-link {
    display: flex;
    align-items: center;
    padding: 7px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #EDEDED;
    border-radius: 4px;
    border-left: 3px solid transparent;
    transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
  }
  header.wth .wth-dropdown .wth-sub-link {
    padding: 9px 18px;
    border-radius: 0;
  }
  header.wth .wth-sub-link:hover {
    color: #FCF6BA;
    background-color: rgba(201, 150, 47, 0.18);
    border-left-color: #D88A2C;
  }
  header.wth .wth-sub-link[aria-current="page"] {
    color: #FCF6BA;
    font-weight: 700;
    background-color: rgba(216, 138, 44, 0.25);
    border-left-color: #D88A2C;
  }

  /* 大選單底部總覽連結列 */
  header.wth .wth-mega-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(201, 150, 47, 0.3);
    display: flex;
    justify-content: flex-end;
  }
  header.wth .wth-mega-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 14px;
    font-weight: 700;
    color: #FCF6BA;
    background-color: rgba(216, 138, 44, 0.2);
    border: 1px solid #C9962F;
    border-radius: 5px;
    transition: background-color 0.18s ease, color 0.18s ease;
  }
  header.wth .wth-mega-all:hover {
    background-color: #D88A2C;
    color: #16283F;
  }
}

/* 1100px～1365px 窄桌機自動縮小字級與間距，保證絕不換行 */
@media (min-width: 1100px) and (max-width: 1365.98px) {
  header.wth .wth-inner {
    padding: 0 12px;
    gap: 8px;
  }
  header.wth .wth-menu {
    gap: 0;
  }
  header.wth .wth-link {
    font-size: 13.5px;
    padding: 0 6px;
  }
  header.wth .wth-has-sub > .wth-item-row > .wth-link {
    padding-right: 2px;
  }
  header.wth .wth-sub-toggle {
    padding: 0 5px 0 1px;
  }
  header.wth .wth-item-cta {
    margin-left: 4px;
  }
  header.wth .wth-link-cta {
    padding: 0 10px !important;
    font-size: 13.5px;
  }
}

/* 尊重使用者動態減量偏好 */
@media (prefers-reduced-motion: reduce) {
  header.wth *,
  header.wth *::before,
  header.wth *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ===== WT_HEADER1031 整合：舊 CMS 固定導覽的首段偏移歸零、舊刊頭殘留隱藏 ===== */
#bannerUse, .moBannerIntact { margin-top: 0 !important; }
body > .page > .wth, body > .wth { margin: 0; }
