.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1100;
  padding: 8px 14px;
  color: #fff;
  background: var(--blue-900);
  border-radius: 6px;
  transform: translateY(-150%);
}

.skip-link:focus {
  color: #fff;
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: #fff;
  border-bottom: 1px solid var(--orange);
  box-shadow: 0 2px 10px rgba(15, 35, 70, 0.08);
}

.header-inner {
  display: flex;
  align-items: flex-end;
  min-height: 78px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.brand-logo {
  width: 65px;
  height: 65px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  flex: 0 0 360px;
  width: 360px;
  gap: 2px;
}

.brand-title {
  color: var(--orange);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.35;
}

.brand-subtitle {
  max-width: 360px;
  color: #334155;
  font-size: 9px;
  line-height: 1.3;
}

.desktop-nav {
  display: none;
  flex: 1;
  justify-content: flex-end;
}

.desktop-nav-list {
  display: flex;
  align-items: stretch;
  margin: 0;
  padding: 4px 0 0;
  color: #fff;
  background: var(--blue-800);
  border-radius: 18px 18px 0 0;
  list-style: none;
}

.desktop-nav-link {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 18px 25px 15px;
  color: #fff;
  border-bottom: 4px solid transparent;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.desktop-nav-link:hover,
.desktop-nav-link:focus,
.desktop-nav-link.is-active,
.nav-dropdown.show > .desktop-nav-link {
  color: #fff;
  border-bottom-color: var(--orange);
}

.desktop-nav .dropdown-menu {
  min-width: 180px;
  padding: 0;
  margin-top: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow);
}

.desktop-nav .nav-dropdown:hover > .dropdown-menu,
.desktop-nav .nav-dropdown:focus-within > .dropdown-menu {
  display: block;
}

.desktop-nav .dropdown-item {
  padding: 18px 25px 15px;
  color: var(--text);
  border-bottom: 3px solid transparent;
  font-size: 14px;
  font-weight: 800;
}

.desktop-nav .dropdown-item:hover,
.desktop-nav .dropdown-item:focus,
.desktop-nav .dropdown-item.is-active {
  color: var(--blue-800);
  background: #f8fafc;
  border-bottom-color: var(--orange);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  margin: 0 0 15px auto;
  color: var(--blue-800);
  background: #fff;
  border: 1px solid rgba(7, 61, 122, 0.16);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15, 35, 70, 0.08);
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.mobile-drawer {
  width: min(360px, 88vw);
}

.mobile-drawer .offcanvas-header {
  border-bottom: 1px solid var(--line);
}

.mobile-drawer-title {
  color: var(--orange);
  font-size: 18px;
  font-weight: 900;
  margin: 0 !important;
}

.mobile-nav {
  display: grid;
  gap: 6px;
}

.mobile-nav-link,
.mobile-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 15px;
  color: var(--blue-800);
  background: #f8fafc;
  border: 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  text-align: left;
}

.mobile-nav-toggle::after {
  width: 10px;
  height: 10px;
  margin-left: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  flex: 0 0 auto;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.mobile-nav-toggle[aria-expanded="true"]::after {
  transform: rotate(-135deg);
}

.mobile-nav-link:hover,
.mobile-nav-link:focus,
.mobile-nav-link.is-active,
.mobile-nav-toggle:hover,
.mobile-nav-toggle:focus,
.mobile-nav-toggle.is-active {
  color: var(--blue-800);
  background: #eef6ff;
}

.mobile-subnav {
  display: grid;
  gap: 4px;
  padding: 5px 0 5px 15px;
}

.mobile-subnav-link {
  padding: 10px 14px;
  color: #334155;
  border-left: 3px solid var(--line);
  font-size: 14px;
  font-weight: 700;
}

.mobile-subnav-link:hover,
.mobile-subnav-link:focus,
.mobile-subnav-link.is-active {
  color: var(--blue-800);
  border-left-color: var(--orange);
}

.page-banner {
  color: #fff;
  background:
    linear-gradient(105deg, rgba(5, 37, 74, 0.98), rgba(11, 79, 147, 0.9)),
    radial-gradient(circle at 80% 10%, rgba(243, 152, 0, 0.7), transparent 34%);
  border-bottom: 5px solid var(--orange);
}

.page-banner-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 190px;
  padding-block: 45px 38px;
}

.page-banner-kicker {
  display: block;
  margin-bottom: 4px;
  color: #fed7aa;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-banner-title {
  margin: 0;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.page-banner-mark {
  color: rgba(255, 255, 255, 0.12);
  font-size: clamp(70px, 10vw, 120px);
  font-weight: 900;
  line-height: 0.75;
}

.breadcrumb-wrap {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.site-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 12px 0;
  color: var(--muted);
  font-size: 14px;
  list-style: none;
}

.site-breadcrumb li + li::before {
  margin-right: 8px;
  color: #94a3b8;
  content: "/";
}

.site-breadcrumb [aria-current="page"] {
  color: var(--blue-800);
  font-weight: 700;
}

.page-title {
  margin-bottom: 26px;
}

.page-title h1 {
  width: fit-content;
  margin: 0;
  color: var(--blue-800);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 900;
}

.page-title h1::after {
  display: block;
  width: 100%;
  height: 4px;
  margin-top: 12px;
  background: var(--orange);
  border-radius: 999px;
  content: "";
}

.page-title p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
}

.site-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.site-search {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.site-search-input,
.site-filter-control {
  min-height: var(--site-control-min-height, 42px);
  padding: var(--site-control-padding, 8px 13px);
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.site-search-input {
  width: min(280px, 100%);
}

.site-filter-control {
  width: 100%;
}

.site-search-input:focus,
.site-filter-control:focus {
  border-color: var(--blue-800);
  outline: 3px solid rgba(12, 61, 99, 0.16);
}

.site-filter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-filter-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 18px;
  color: var(--blue-800);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
}

.site-filter-link:hover,
.site-filter-link:focus {
  color: #fff;
  background: var(--blue-800);
  border-color: var(--blue-800);
}

.site-filter-nav li.active .site-filter-link {
  color: #fff;
  background: var(--orange);
  border-color: var(--orange);
}

.site-filter-nav li.active .site-filter-link:hover,
.site-filter-nav li.active .site-filter-link:focus {
  background: var(--blue-800);
  border-color: var(--blue-800);
}

.site-result-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.site-result-count {
  color: var(--muted);
  font-size: 14px;
}

.site-card {
  min-width: 0;
  overflow: var(--site-card-overflow, hidden);
  background: var(--card);
  border: 1px solid var(--site-card-border, var(--line));
  border-radius: var(--site-card-radius, 14px);
  box-shadow: var(--site-card-shadow, var(--shadow));
}

.site-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: var(--site-pagination-margin-top, 28px);
}

.site-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--site-page-size, 42px);
  height: var(--site-page-size, 42px);
  padding: 0 12px;
  color: var(--blue-800);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.site-page-link:hover,
.site-page-link:focus,
.site-page-link.is-current {
  color: #fff;
  background: var(--blue-800);
  border-color: var(--blue-800);
}

.site-page-link.is-disabled {
  color: #94a3b8;
  background: #f8fafc;
  pointer-events: none;
}

.site-more {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-self: center;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.site-more::before {
  position: absolute;
  top: -6px;
  left: -10px;
  width: 35px;
  height: 35px;
  background: #f7bf46;
  border-radius: 50px;
  content: "";
  transition: all 0.3s ease;
}

.site-more span {
  position: relative;
  color: #555;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.site-more svg {
  position: relative;
  top: 0;
  margin-left: 5px;
  fill: none;
  stroke: #555;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateX(-5px);
  transition: all 0.3s ease;
}

.site-more:hover::before,
.site-more:focus-visible::before {
  width: 130%;
  background: #b1dae7;
}

.site-more:hover svg,
.site-more:focus-visible svg {
  transform: translateX(0);
}

.site-more:focus-visible {
  outline: 2px solid var(--blue-800);
  outline-offset: 8px;
}

.site-more:active {
  transform: scale(0.95);
}

@media (prefers-reduced-motion: reduce) {
  .site-more::before,
  .site-more svg {
    transition: none;
  }
}

.site-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 9px 18px;
  color: #fff;
  background: var(--blue-800);
  border: 1px solid var(--blue-800);
  border-radius: 8px;
  font-weight: 800;
}

.site-button:hover,
.site-button:focus {
  color: #fff;
  background: var(--blue-700);
}

.site-button:disabled,
.site-button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.65;
}

.site-button-secondary {
  color: var(--blue-800);
  background: #fff;
}

.site-button-secondary:hover,
.site-button-secondary:focus {
  color: var(--blue-800);
  background: #eef6ff;
}

.empty-state {
  display: block;
  margin-top: 28px;
  padding: 46px 24px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.empty-state[hidden] {
  display: none !important;
}

.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: 12px;
  color: var(--blue-800);
  background: #eef6ff;
  border-radius: 50%;
  font-size: 26px;
  font-weight: 900;
}

.empty-state h1,
.empty-state h2 {
  margin: 0 0 6px;
  color: var(--blue-800);
  font-size: 21px;
  font-weight: 900;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.empty-state .site-button {
  margin-top: 18px;
}

.site-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 3px 10px;
  color: var(--blue-800);
  background: #e8f2ff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.site-badge-pinned {
  color: #fff;
  background: #c81e1e;
}

/* 列表封面左上角「置頂」（據點動態、訓練資源） */
.cover-pinned-badge {
  position: absolute;
  top: 12px;
  left: 0;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 5px 10px;
  color: #fff;
  background: #c81e1e;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}

.site-badge-news {
  color: var(--blue-800);
  background: #e8f2ff;
}

.site-badge-jobs {
  color: #9a3412;
  background: #ffedd5;
}

.site-badge-gallery {
  color: #166534;
  background: #dcfce7;
}

.site-badge-courses {
  color: #6b21a8;
  background: #f3e8ff;
}

.training-status-badge {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.training-status-open {
  color: #166534;
  background: #dcfce7;
}

.training-status-upcoming {
  color: #6b21a8;
  background: #f3e8ff;
}

/* 灰色實心，與卡片下方淺灰底標籤區隔 */
.training-status-closed,
.training-status-ended {
  color: #fff;
  background: #64748b;
}

.training-status-ongoing {
  color: #075985;
  background: #e0f2fe;
}

.training-status-cancelled {
  color: #991b1b;
  background: #fee2e2;
}

.site-footer {
  margin-top: 32px;
  color: #fff;
  background: var(--blue-800);
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(280px, 1.5fr) minmax(420px, 2.4fr) minmax(160px, 1fr);
  gap: 28px;
  padding-block: 40px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  width: 150px;
  height: 150px;
  object-fit: contain;
}

.footer-brand-title {
  margin: 2px 0 7px;
  color: var(--orange);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.45;
}

.footer-brand-subtitle {
  margin: 0;
  color: #dbeafe;
  font-size: 13px;
  line-height: 1.5;
}

.footer-navigation {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 20px;
}

.footer-nav-group {
  min-width: 0;
}

.footer-nav-summary {
  margin: 4px 0 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  list-style: none;
  cursor: default;
}

.footer-nav-summary::-webkit-details-marker {
  display: none;
}

.footer-nav h2 {
  margin: 4px 0 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.footer-nav a {
  display: block;
  padding: 3px 0;
  color: #dbeafe;
  font-size: 13px;
  line-height: 1.5;
  transition: color 0.3s linear;
}

.footer-nav a:hover,
.footer-nav a:focus {
  color: var(--orange);
  text-decoration: none;
}

.footer-social {
  display: flex;
  gap: 9px;
  margin-top: 13px;
}

.footer-social a {
  width: 34px;
  height: 34px;
  background-position: center;
  background-size: cover;
  border-radius: 8px;
}

.footer-social .fb {
  background-image: url("../icons/fb.png");
}

.footer-social .ig {
  background-image: url("../icons/ig.png");
}

.footer-social .line {
  background-image: url("../icons/line.png");
}

.footer-social-static span,
.footer-social-static a {
  width: 48px;
  height: 48px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

/* 後台已填網址的社群圖示（任務30 #9）：可點擊，hover 微調透明度 */
.footer-social-static a {
  border-radius: 0;
  transition: opacity 0.18s ease;
}

.footer-social-static a:hover,
.footer-social-static a:focus-visible {
  opacity: 0.82;
}

.footer-counter {
  display: flex;
  gap: 4px;
}

.footer-counter span {
  padding: 5px 7px;
  background: var(--blue-900);
  border-radius: 4px;
  font-family: monospace;
  font-size: 20px;
}

.footer-side {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 18px;
}

.footer-bottom {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 24px;
  color: #dbeafe;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.footer-bottom a {
  color: #fff;
}

.footer-bottom a::after {
  margin-left: 8px;
  color: #dbeafe;
  content: "|";
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1060;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  color: #fff;
  background: var(--orange);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 12px 24px rgba(223, 107, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background-color 0.25s ease;
  cursor: pointer;
}

.back-to-top:hover {
  background: var(--orange-dark);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

@media (min-width: 1225px) {
  .desktop-nav {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }
}

@media (max-width: 1224px) {
  .header-inner {
    align-items: center;
  }

  .nav-toggle {
    margin-bottom: 0;
  }

}

@media (max-width: 1024px) {
  .footer-main {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-block: 34px 30px;
  }

  .footer-brand {
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }

  .footer-logo {
    width: 104px;
    height: 104px;
  }

  .footer-navigation {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .footer-nav-group {
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
  }

  .footer-nav-summary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 11px 42px 11px 15px;
    margin: 0;
    cursor: pointer;
  }

  .footer-nav-summary::after {
    position: absolute;
    right: 17px;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--orange);
    border-bottom: 2px solid var(--orange);
    content: "";
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease;
  }

  .footer-nav-group[open] .footer-nav-summary::after {
    transform: translateY(3px) rotate(-135deg);
  }

  .footer-nav-group[open] .footer-nav-summary {
    color: var(--orange);
    background: rgba(255, 255, 255, 0.05);
  }

  .footer-nav-group a {
    padding: 9px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .footer-side {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px 20px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }

  .footer-side h2 {
    grid-column: 1 / -1;
    margin: 0;
  }

  .footer-social {
    justify-content: flex-end;
    margin-top: 0;
  }

}

@media (max-width: 991px) {
  .site-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .site-search {
    width: 100%;
  }

  .site-search-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }
}

@media (max-width: 767px) {
  .header-inner {
    min-height: 68px;
  }

  .brand {
    gap: 8px;
    padding: 5px 0;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
  }

  .brand-title {
    font-size: 14px;
  }

  .brand-copy {
    flex: 1 1 auto;
    width: auto;
  }

  .brand-subtitle {
    display: none;
  }

  .page-banner-inner {
    min-height: 145px;
    padding-block: 34px 28px;
  }

  .page-banner-mark {
    display: none;
  }

  .footer-brand {
    align-items: center;
  }

  .footer-logo {
    width: 82px;
    height: 82px;
  }

  .footer-brand-title {
    font-size: 17px;
  }

  .footer-brand-subtitle {
    font-size: 11px;
  }

  .footer-side {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    gap: 12px;
  }

  .footer-social {
    justify-content: flex-end;
  }

  .footer-counter {
    gap: 3px;
  }

  .footer-counter span {
    padding: 4px 5px;
    font-size: 16px;
  }

  .footer-social-static span,
  .footer-social-static a {
    width: 38px;
    height: 38px;
  }

  .footer-bottom {
    gap: 5px;
    padding: 13px 8px;
    font-size: 10px;
  }

  .footer-bottom a::after {
    margin-left: 5px;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 48px;
    height: 48px;
  }
}

/* ============================================================
   共用封面比例樣式：16:9（文章封面／影片封面共用）
   用途：首頁「趨勢知識」文章封面、「影片專區」影片封面等
   避免業主上傳非約定比例的圖片時被強制拉伸變形

   基本用法（僅統一比例，圖片本身已是 16:9 時使用）：
     <div class="site-ratio-16x9">
       <img src="cover.jpg" alt="">
     </div>

   含模糊底圖用法（業主上傳非 16:9 圖片時，
   自動以該圖模糊化填滿容器留白處）：
     <div class="site-ratio-16x9 site-cover-blur" style="--bg-url:url('cover.jpg')">
       <img src="cover.jpg" alt="">
     </div>
   ============================================================ */

.site-ratio-16x9 {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.site-cover-blur {
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

/* 模糊背景底圖：以 --bg-url 產生模糊化背景，鋪滿容器空白處 */
.site-cover-blur::before {
  content: "";
  position: absolute;
  inset: -16px;
  z-index: 0;
  background-image: var(--bg-url);
  background-position: center;
  background-size: cover;
  filter: blur(20px);
}

/* 業主封面圖／影片封面：需疊於模糊底圖之上，並水平垂直置中 */
.site-cover-blur > img,
.site-cover-blur > picture,
.site-cover-blur > video,
.site-cover-blur > .site-cover-blur-content {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  object-fit: contain;
}
