/* ===== 易連工業 EASYLINK — 留白・中性・單一強調色 ===== */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600;700;800&display=swap");

:root {
  /* 中性：深灰 / slate（與主色同色系） */
  --nav-bg: #0f172a;
  --nav-bg-2: #1e293b;
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748b;
  /* 主色：綠色系，全站按鈕/連結/裝飾統一 */
  --accent: #059669;
  --accent-hover: #047857;
  --accent-light: #d1fae5;
  --accent-muted: rgba(5, 150, 105, 0.12);
  --accent-soft: #10b981;
  /* 點綴：僅用於「重點強調」（如新廠、數字） */
  --highlight: #b45309;
  --highlight-light: #fef3c7;
  /* 背景 */
  --bg-page: #ffffff;
  --bg-section-alt: #f8fafc;
  --bg-placeholder: #f1f5f9;
  /* 邊框與陰影（與主色一致） */
  --border-soft: rgba(15, 23, 42, 0.08);
  --border-accent: rgba(5, 150, 105, 0.25);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 4px 20px rgba(5, 150, 105, 0.1);
}

* {
  font-family: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  letter-spacing: 0.02em;
  color: var(--ink-900);
  background: var(--bg-page);
}

/* ----- 導覽列：深綠系（與主色協調，非黑） ----- */
.nav-grad {
  background: linear-gradient(180deg, #065f46 0%, #047857 50%, #065f46 100%);
  box-shadow: 0 2px 12px rgba(4, 120, 87, 0.3);
  border-bottom: 3px solid #34d399;
}

.nav-link {
  font-weight: 500;
  transition: color 0.2s ease;
}
.nav-link:hover {
  color: var(--accent-light) !important;
}
.nav-link.active {
  color: #fff !important;
  font-weight: 700;
}
.nav-grad > .container {
  width: 100%;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 2vw, 1.5rem);
  padding-right: clamp(1rem, 2vw, 1.5rem);
}
@media (min-width: 1400px) {
  .nav-grad > .container {
    width: 80%;
    padding-left: clamp(0.5rem, 1.2vw, 1rem);
    padding-right: clamp(0.5rem, 1.2vw, 1rem);
  }
}
[id^="section-"] {
  scroll-margin-top: calc(var(--home-nav-h, 80px) + 8px);
}

.navbar-brand .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
}

.navbar-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.6rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.navbar-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  display: block;
}
.nav-grad .navbar-logo-wrap .navbar-logo {
  filter: brightness(0) invert(1);
}
.navbar-brand-tagline {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.82);
}
@media (min-width: 1400px) {
  .nav-grad .navbar-collapse {
    flex-grow: 1;
    justify-content: flex-end;
    min-width: 0;
    gap: 0.35rem;
  }
  .nav-grad .navbar-nav {
    flex-wrap: nowrap;
    align-items: center;
    min-width: 0;
  }
  .nav-grad .nav-link {
    white-space: nowrap;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .nav-grad .navbar-brand {
    margin-right: 0.75rem;
  }
  .nav-grad .navbar-brand-cluster {
    margin-right: 0.25rem;
  }
}

/* ----- Hero：留白、無整頁圖、深色字 + 主色點綴 ----- */
.hero {
  position: relative;
  background: linear-gradient(160deg, var(--bg-page) 0%, var(--bg-section-alt) 50%, #ecfdf5 100%);
  color: var(--ink-900);
  border-bottom: 1px solid var(--border-soft);
}
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft) 50%, transparent 100%);
  opacity: 0.85;
}
.hero > * {
  position: relative;
}
.hero .kicker {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.hero .headline {
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--ink-900);
}
.hero .sub {
  color: var(--ink-700);
  max-width: 64ch;
}
.hero .hero-card {
  background: #fff;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-md);
}
.hero .hero-card .fw-semibold {
  color: var(--ink-900);
}
.hero .hero-card .small,
.hero .hero-card .text-white-50 {
  color: var(--ink-600) !important;
}
.hero .hero-card hr {
  border-color: var(--border-soft);
}
.hero .hero-card a {
  color: var(--accent);
}
.hero .pill {
  background: var(--accent-muted);
  border: 1px solid var(--border-accent);
  color: var(--ink-700);
}
.hero .btn-primary {
  background: var(--accent);
  border: none;
  color: #fff;
}
.hero .btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}
.hero .btn-outline-secondary {
  border: 2px solid var(--ink-500);
  color: var(--ink-700);
}
.hero .btn-outline-secondary:hover {
  background: var(--bg-section-alt);
  border-color: var(--ink-700);
  color: var(--ink-900);
}

.hero-headquarters {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-soft);
}
.hero-headquarters-img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
}
.hero-headquarters-caption {
  position: absolute;
  bottom: 0.75rem;
  left: 1rem;
  padding: 0.35rem 0.75rem;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
}

/* 首頁：圖／檔可點開新分頁檢視（瀏覽器內放大） */
.asset-view-link {
  text-decoration: none;
  color: inherit;
  cursor: zoom-in;
  transition: opacity 0.2s ease, box-shadow 0.2s ease, outline-color 0.15s ease;
}
.asset-view-link:hover {
  opacity: 0.92;
}
.asset-view-link:focus-visible {
  outline: 3px solid rgba(52, 211, 153, 0.85);
  outline-offset: 3px;
}
.hero-headquarters-img-link {
  display: block;
  width: 100%;
}
.cert-photo-wrap .cert-photo-view-link {
  display: block;
}
.navbar-brand-cluster .navbar-logo-svg-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.45rem;
  margin-left: 0.1rem;
  color: rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  font-size: 0.75rem;
  cursor: pointer;
}
.navbar-brand-cluster .navbar-logo-svg-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.smart-factory-visual-row .smart-factory-panel-figure .smart-factory-panel-link {
  width: 100%;
  flex: 0 0 auto;
}
.asset-preview-modal .modal-dialog {
  max-width: min(1200px, 96vw);
}
.asset-preview-modal .modal-content {
  border: 0;
  border-radius: 16px;
  overflow: hidden;
}
.asset-preview-modal .modal-header {
  border-bottom: 1px solid var(--border-soft);
}
.asset-preview-brand {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
}
.asset-preview-logo {
  height: 28px;
  width: auto;
  display: block;
}
.asset-preview-modal .modal-body {
  padding: 0.75rem;
  background: #0b1220;
}
.asset-preview-body {
  min-height: min(70vh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.asset-preview-image {
  max-width: 100%;
  max-height: min(84vh, 820px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.asset-preview-frame {
  width: 100%;
  height: min(84vh, 820px);
  border: 0;
  background: #fff;
}

/* ----- 區塊標題 ----- */
.section-title {
  font-weight: 800;
  color: var(--ink-900);
}
.section-sub {
  color: var(--ink-700);
  max-width: 78ch;
}

/* ----- 區塊節奏 ----- */
.section {
  padding: 80px 0;
}
/* 首頁一頁一區：縮小區塊頂部留白，讓標題與內容較靠近 snap 區上緣（不動 section--breathing） */
body.home-snap .snap-section.section:not(.section--breathing) {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}
.section-alt {
  background: var(--bg-section-alt);
}
/* 覆蓋 pt-0，讓「我們能為你做什麼」與上方 ESG 區有足夠留白 */
.section.pt-0.section--breathing {
  padding-top: 5.5rem !important;
}

/* ----- 首頁一頁一區塊滾動 ----- */
body.home-snap {
  --home-nav-h: 72px;
  scroll-snap-type: y mandatory;
  scroll-padding-top: var(--home-nav-h);
  scroll-behavior: smooth;
}
body.home-snap .snap-section {
  height: calc(100vh - var(--home-nav-h));
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
/* JS 判定視窗比例/內容無法一屏一區時：改一般整頁捲動（見 site.js initHomeSnapScroll） */
body.home-snap.home-snap--flow {
  scroll-snap-type: none;
}
body.home-snap.home-snap--flow .snap-section,
body.home-snap.home-snap--flow .snap-section.snap-section--free {
  height: auto;
  min-height: 0;
  overflow: visible;
  scroll-snap-align: none;
  scroll-snap-stop: normal;
}
body.home-snap.home-snap--flow .hero-stats-combo {
  overflow: visible;
}
/* 可吸附但不限單頁高度（用於客戶評價長內容） */
body.home-snap .snap-section.snap-section--free {
  height: calc(100vh - var(--home-nav-h));
  min-height: calc(100vh - var(--home-nav-h));
  overflow-y: auto;
  overscroll-behavior: contain;
}
body.home-snap .hero-stats-combo {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.home-snap .hero-stats-combo .hero {
  flex: 1 1 auto;
  border-bottom: none;
}
body.home-snap .hero-stats-combo .hero .container {
  padding-top: 2.25rem !important;
  padding-bottom: 2rem !important;
}
body.home-snap .hero-stats-combo .stats-dark {
  flex: 0 0 auto;
  padding: 1.5rem 0;
}
body.home-snap .final-footer-combo {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: calc(100vh - var(--home-nav-h));
  background: var(--bg-page);
}
body.home-snap .final-footer-combo .section {
  flex: 0 0 auto;
  margin-bottom: 0;
  padding-top: 1.1rem !important;
  padding-bottom: 0.75rem !important;
  background: var(--bg-page);
}
body.home-snap .final-footer-combo .footer {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 1.25rem !important;
  padding-bottom: 0.9rem !important;
}
body.home-snap #section-contact .soft-panel {
  padding: 1rem 1.25rem !important;
}
body.home-snap #section-contact .soft-panel .feature {
  padding: 0.9rem !important;
}
body.home-snap #section-contact .soft-panel .row.g-4 {
  --bs-gutter-y: 0.9rem;
  --bs-gutter-x: 1rem;
}
body.home-snap #section-contact .soft-panel .row.g-3 {
  --bs-gutter-y: 0.65rem;
  --bs-gutter-x: 0.9rem;
}
body.home-snap #section-contact .form-label {
  margin-bottom: 0.2rem;
}
body.home-snap #section-contact .form-control {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}
body.home-snap #section-contact .footer-map {
  height: 220px;
}
body.home-snap #section-contact .footer .my-4 {
  margin-top: 0.8rem !important;
  margin-bottom: 0.8rem !important;
}

/* ----- 功能卡片：白底、左線強調色 ----- */
.feature {
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.2s ease;
  border-left: 4px solid var(--accent);
}
.feature:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}
.feature .icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-muted);
  border: 1px solid var(--border-accent);
  color: var(--accent);
  font-weight: 800;
  font-size: 1rem;
}
.feature .icon i {
  font-size: 1.2rem;
}

/* ----- 媒體卡片：可無圖、圖片區留白 ----- */
.media-card {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: #fff;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.25s ease, transform 0.2s ease;
}
.media-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.media-card img {
  width: 100%;
  height: auto;
  display: block;
}
.media-card-img-wrap {
  min-height: 180px;
  background: var(--bg-placeholder);
}
.media-card-img-wrap img {
  object-fit: cover;
  max-height: 420px;
}
.media-card-placeholder {
  height: 200px;
  background: var(--bg-placeholder);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-500);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.media-card-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  padding: 1rem;
}
.media-card-placeholder-inner i {
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.media-card-placeholder-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
}
.media-card-placeholder-meta {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.92);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.media-card-placeholder--factory {
  background: linear-gradient(140deg, #0f766e 0%, #0ea5a4 55%, #5eead4 100%);
}
.media-card-placeholder--quality {
  background: linear-gradient(140deg, #14532d 0%, #16a34a 55%, #4ade80 100%);
}

/* 產品目錄：官網產品 DM 三圖（無內文；三欄用自訂 grid，避免 Bootstrap row 破壞高度） */
.product-catalog-dm-grid {
  display: grid;
  gap: 0.75rem;
}
.product-catalog-dm-card {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.18s ease, border-color 0.18s ease;
}
.product-catalog-dm-card:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
  border-color: var(--border-accent);
}
.product-catalog-dm-card img,
.product-catalog-dm-img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
  object-fit: contain;
  background: #fff;
}

/* 首頁 snap：產品目錄填滿一頁，三圖吃滿可分配空間 */
body.home-snap #section-product-catalog {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  box-sizing: border-box;
}
body.home-snap #section-product-catalog.section:not(.section--breathing) {
  padding-top: 1.75rem;
  padding-bottom: 1.25rem;
}
body.home-snap #section-product-catalog .container.product-catalog-snap-inner {
  flex: 1 1 0%;
  display: flex;
  min-height: 0;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
}
body.home-snap #section-product-catalog .section-title-underline {
  margin-bottom: 0.5rem;
  flex: 0 0 auto;
}
body.home-snap #section-product-catalog .product-catalog-dm-grid {
  flex: 1 1 0%;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 0.75rem;
  align-items: stretch;
  /* flex 高度鏈若被其他樣式打斷時，仍給圖區一個接近一屏的可用高度 */
  min-height: min(82vh, calc(100vh - var(--home-nav-h) - 7rem));
}
@media (max-width: 767.98px) {
  body.home-snap #section-product-catalog .product-catalog-dm-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, minmax(140px, 26vh));
    min-height: 0;
  }
}
body.home-snap #section-product-catalog .product-catalog-dm-card {
  min-height: 0;
  min-width: 0;
  height: 100%;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  padding: 0;
  align-self: stretch;
  box-sizing: border-box;
  overflow: hidden;
  place-items: center;
}
body.home-snap #section-product-catalog .product-catalog-dm-card img,
body.home-snap #section-product-catalog .product-catalog-dm-img {
  box-sizing: border-box;
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  min-height: 0;
  min-width: 0;
  object-fit: contain;
  object-position: center;
  margin: 0;
}

/* 品質控制：PPT 圖片圖庫 */
#section-quality-control {
  overflow: hidden;
}
body.home-snap #section-quality-control {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 2.5rem;
}
body.home-snap #section-quality-control .container {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  flex-direction: column;
}
.quality-control-gallery {
  display: grid;
  gap: 0.7rem;
}
.quality-control-gallery--slide8 {
  flex: 1 1 auto;
  min-height: 0;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-template-rows: repeat(3, minmax(118px, 1fr));
  grid-template-areas:
    "left-top main main right-top"
    "left-middle main main right-middle"
    "left-bottom bottom-left bottom-right right-bottom";
}
.quality-control-card {
  display: block;
  overflow: hidden;
  height: 100%;
  min-height: 118px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.quality-control-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card);
}
.quality-control-card img {
  width: 100%;
  height: 100%;
  min-height: 118px;
  display: block;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.quality-control-card:hover img {
  transform: scale(1.025);
}
.quality-control-card--main {
  grid-area: main;
}
.quality-control-card--left-top {
  grid-area: left-top;
}
.quality-control-card--left-middle {
  grid-area: left-middle;
}
.quality-control-card--left-bottom {
  grid-area: left-bottom;
}
.quality-control-card--bottom-left {
  grid-area: bottom-left;
}
.quality-control-card--bottom-right {
  grid-area: bottom-right;
}
.quality-control-card--right-top {
  grid-area: right-top;
}
.quality-control-card--right-middle {
  grid-area: right-middle;
}
.quality-control-card--right-bottom {
  grid-area: right-bottom;
}

@media (max-width: 991.98px) {
  .quality-control-gallery--slide8 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "main main"
      "left-top right-top"
      "left-middle right-middle"
      "left-bottom right-bottom"
      "bottom-left bottom-right";
  }
}

@media (max-width: 575.98px) {
  .quality-control-gallery--slide8 {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "left-top"
      "right-top"
      "left-middle"
      "right-middle"
      "left-bottom"
      "bottom-left"
      "bottom-right"
      "right-bottom";
  }
}

/* ----- 數據卡 ----- */
.stat {
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  border-left: 4px solid var(--accent);
}
.stat:hover {
  box-shadow: var(--shadow-card);
}
.stat .k {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--accent);
}
.stat .d {
  color: var(--ink-600);
  font-size: 0.9rem;
}

/* ----- CTA 面板 ----- */
.soft-panel {
  border: 1px solid var(--border-accent);
  background: linear-gradient(135deg, var(--accent-muted) 0%, #fff 100%);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
}

/* ----- 按鈕 ----- */
.btn-primary {
  background: var(--accent);
  border: none;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(5, 150, 105, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.35);
}
.btn-outline-primary {
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.btn-outline-primary:hover {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent-hover);
}

/* ----- 頁尾 ----- */
.footer {
  background: linear-gradient(180deg, var(--nav-bg), #0a0f1a);
  color: rgba(255, 255, 255, 0.9);
  border-top: 3px solid var(--accent);
}
.footer-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  opacity: 0.95;
}

.global-flag {
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.footer a {
  color: #c7d2fe;
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer a:hover {
  color: #fff;
  text-decoration: underline;
}
.footer-map-wrap {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.65);
}
.footer-map {
  width: 100%;
  height: 150px;
  border: 0;
  display: block;
}

/* ----- 標籤 ----- */
.badge-soft {
  background: var(--accent-muted);
  border: 1px solid var(--border-accent);
  color: var(--accent-hover);
  font-weight: 600;
}

/* ----- 內頁標題區：留白、無整頁圖、頂線強調 ----- */
.page-hero {
  position: relative;
  background: var(--bg-section-alt);
  color: var(--ink-900);
  border-bottom: 1px solid var(--border-soft);
}
.page-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  opacity: 0.6;
}
.page-hero .container {
  position: relative;
}
.page-hero .text-white-50 {
  color: var(--ink-600) !important;
}
.page-hero .pill {
  background: var(--accent-muted);
  border: 1px solid var(--border-accent);
  color: var(--ink-700);
}

.breadcrumb-lite {
  --bs-breadcrumb-divider: "›";
}

/* ----- 首頁：新廠動工消息 ----- */
.news-card {
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border-left: 4px solid var(--accent);
  transition: box-shadow 0.2s ease;
}
.news-card:hover {
  box-shadow: var(--shadow-card);
}
.news-card .news-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
}
.news-card .news-title {
  font-weight: 800;
  color: var(--ink-900);
}
.news-card .news-meta {
  color: var(--ink-600);
  font-size: 0.9rem;
}

/* ----- 首頁：產品類別（多樣製程／產能） ----- */
.product-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.category-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-700);
  background: #fff;
  border: 1px solid var(--border-soft);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.category-pill:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
  color: var(--accent-hover);
}

/* ----- 首頁：品質管理證書 ----- */
.cert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.cert-item {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-700);
  background: #fff;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.cert-item:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card);
}
.cert-item .cert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.5rem;
}

/* ----- ESG／永續經營：與主色協調的柔和綠 ----- */
:root {
  --esg-bg: #ecfdf5;
  --esg-bg-2: #d1fae5;
  --esg-border: rgba(5, 150, 105, 0.18);
  --esg-accent: #047857;
  --esg-accent-light: #a7f3d0;
}

.esg-section {
  background: linear-gradient(180deg, var(--esg-bg) 0%, var(--esg-bg-2) 100%);
  border-top: 1px solid var(--esg-border);
  border-bottom: 1px solid var(--esg-border);
}

.esg-section .section-title {
  color: var(--ink-900);
}

.esg-pillar {
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--esg-border);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.esg-pillar:hover {
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.12);
}

.esg-pillar .esg-pillar-head {
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--esg-accent);
  background: var(--esg-accent-light);
  border-bottom: 1px solid var(--esg-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.esg-pillar .esg-pillar-body {
  padding: 1.25rem;
  color: var(--ink-700);
  font-size: 0.95rem;
}

.esg-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--esg-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.esg-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--esg-accent);
  background: var(--esg-accent-light);
  border: 1px solid var(--esg-border);
}

.esg-intro {
  color: var(--ink-700);
  max-width: 72ch;
}

.page-hero--esg::before {
  background: linear-gradient(90deg, var(--esg-accent), transparent 70%);
}

/* ===== 設計感強化（與主色協調） ===== */
:root {
  --slate-800: #1e293b;
  --slate-900: #0f172a;
}

/* 漸層文字：主色藍系，與全站一致 */
.gradient-text {
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-soft) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hero 左線：主色 */
.hero-strip {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  font-weight: 700;
  color: var(--ink-700);
}
.hero-location-links {
  margin-top: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-soft);
}
.hero-location-hq {
  font-weight: 800;
  color: var(--ink-900);
  font-size: 1rem;
  letter-spacing: 0.02em;
}
.hero-location-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent-hover);
  text-decoration: none;
  transition: color 0.2s ease;
}
.hero-location-link:hover,
.hero-location-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

/* 深色數據條：與 nav 同色系，數字統一用淺藍 */
.stats-dark {
  background: var(--slate-900);
  color: #fff;
  padding: 3rem 0;
}
.stats-dark .stat-num {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: #6ee7b7;
}
.stats-dark .stat-num--highlight { color: #fcd34d; }
.stats-dark .stat-desc { color: #94a3b8; font-size: 0.9rem; }

/* 最新消息：淡藍底與主色一致，badge 用主色 */
.section-news {
  background: #eff6ff;
  border-top: 1px solid rgba(5, 150, 105, 0.12);
  border-bottom: 1px solid rgba(5, 150, 105, 0.12);
}
.news-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.news-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-weight: 500;
  color: var(--ink-700);
}
.news-list-item i {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 0.2em;
}
/* 避免 flex 將 <i>、文字、<strong>、<a> 拆成多個橫向子項導致版面碎裂 */
.news-list-item-body {
  flex: 1;
  min-width: 0;
}
.news-item-sublist {
  list-style-type: disc;
  margin: 0.5rem 0 0 0;
  padding-left: 1.25rem;
  font-size: 0.95rem;
  color: var(--ink-600);
  line-height: 1.55;
}
.news-item-sublist li {
  margin-bottom: 0.35rem;
}
.news-item-sublist li:last-child {
  margin-bottom: 0;
}
.news-item-label {
  display: block;
  font-weight: 700;
  color: var(--ink-800);
  margin-bottom: 0.25rem;
}

/* 區塊標題：底線／左線皆用主色 */
.section-title-underline {
  display: inline-block;
  padding-bottom: 0.35rem;
  border-bottom: 3px solid var(--accent);
  margin-bottom: 0.5rem;
}
.section-title-border-left {
  border-left: 6px solid var(--accent);
  padding-left: 1rem;
  font-weight: 800;
}

/* 深色卡片：頂線與標題帶可區分藍／綠／黃 */
.card-dark {
  background: var(--slate-800);
  color: #fff;
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  border-top: 4px solid var(--accent-soft);
}
.card-dark--top-blue { border-top-color: #2563eb; }
.card-dark--top-green { border-top-color: #059669; }
.card-dark--top-yellow { border-top-color: #ca8a04; }
.card-dark .card-dark-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: -1.5rem -2rem 1rem -2rem;
  padding: 0.75rem 2rem;
  font-style: italic;
  border-radius: 0.85rem 0.85rem 0 0;
}
.card-dark-title--blue {
  background: #1d4ed8;
  color: #fff;
}
.card-dark-title--green {
  background: #047857;
  color: #fff;
}
.card-dark-title--yellow {
  background: #eab308;
  color: #0f172a;
}
.card-dark .card-dark-list { color: #94a3b8; font-size: 0.9rem; font-weight: 600; }
.card-dark .card-dark-list li { margin-bottom: 0.35rem; }

/* 設備數字：淺藍與主色一致 */
.equip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.95rem;
}
.equip-row .equip-num { font-weight: 800; color: #6ee7b7; }

/* 證書區：hover 用主色 */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.cert-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border: 2px solid var(--border-soft);
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-600);
  background: #fff;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.cert-box:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  box-shadow: var(--shadow-card);
}

.cert-photo-grid .cert-photo-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.cert-photo-grid .cert-photo {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  display: block;
}
.cert-photo-wrap--doc {
  background: #f8fafc;
}
/* 必須高於 .cert-photo-grid .cert-photo，否則 cover + 固定高度會裁切整張證書 */
.cert-photo-grid .cert-photo.cert-photo--document {
  height: auto;
  max-height: 520px;
  min-height: unset;
  object-fit: contain;
  object-position: center top;
  padding: 0.5rem;
}
.cert-photo--document {
  height: auto;
  max-height: 420px;
  min-height: 240px;
  object-fit: contain;
  padding: 0.5rem;
}
.cert-photo-grid .cert-photo-caption {
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-600);
  margin-top: 0.5rem;
  font-weight: 600;
}

/* 客戶評價（testimonial 郵件） */
.testimonial-section {
  background: #ffffff;
}
.testimonial-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.testimonial-tab {
  border: none;
  background: #0f4f4d;
  color: #fff;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.15s ease, background 0.2s ease;
}
.testimonial-tab:hover {
  background: #0b6663;
  transform: translateY(-1px);
}
.testimonial-tab.is-active {
  background: var(--accent);
}
.testimonial-grid--masonry {
  column-count: 1;
  column-gap: 1rem;
}
@media (min-width: 768px) {
  .testimonial-grid--masonry {
    column-count: 2;
  }
}
@media (min-width: 1200px) {
  .testimonial-grid--masonry {
    column-count: 3;
  }
}
.testimonial-grid--masonry > [class*="col-"] {
  display: inline-block;
  width: 100%;
  padding: 0;
  margin: 0 0 1rem 0;
  break-inside: avoid;
  vertical-align: top;
}
.testimonial-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.testimonial-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card);
}
.testimonial-card-title {
  font-weight: 800;
  color: #0f4f4d;
  padding: 0.65rem 0.8rem 0.4rem;
  font-size: 1rem;
}
.testimonial-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  object-position: center top;
  display: block;
  background: #f8fafc;
}
.testimonial-card--award .testimonial-image {
  height: 210px;
  object-fit: contain;
  object-position: center;
  background: #fff;
}
.testimonial-card-caption {
  text-align: center;
  padding: 0.55rem 0.8rem 0.8rem;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.92rem;
}
@media (max-width: 767.98px) {
  .testimonial-image {
    height: 124px;
  }
  .testimonial-card--award .testimonial-image {
    height: 178px;
  }
}

.smart-factory-hero-img {
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-md);
}
.smart-factory-visual-row .smart-factory-panel-figure {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
/* 三欄同寬（Bootstrap col）下，固定相同顯示高度，object-fit: contain 等比置入、不變形 */
.smart-factory-visual-row .smart-factory-panel-figure .smart-factory-hero-img {
  display: block;
  width: 100%;
  height: clamp(200px, 28vh, 300px);
  max-height: clamp(200px, 28vh, 300px);
  object-fit: contain;
  object-position: center;
  background: #f8fafc;
  flex: 0 0 auto;
}
@media (max-width: 767.98px) {
  .smart-factory-visual-row .smart-factory-panel-figure .smart-factory-hero-img {
    height: clamp(180px, 22vh, 260px);
    max-height: clamp(180px, 22vh, 260px);
  }
}
body.home-snap .smart-factory-visual-row {
  align-items: stretch;
}

/* 品質區圖示與主色一致 */
.accent-icons .fa-shield-alt,
.accent-icons .fa-undo-alt { color: var(--accent); }

/* 產品小卡：左線主色 */
.product-mini-card {
  padding: 1rem;
  background: var(--bg-section-alt);
  border-radius: 12px;
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow-sm);
}
.product-mini-card .product-mini-title { font-weight: 700; color: var(--ink-900); }
.product-mini-card .product-mini-desc { font-size: 0.8rem; color: var(--ink-500); margin-top: 0.25rem; }

/* 廠區導覽：首頁一頁一區，網格＋箭頭同屏、不重疊 */
body.home-snap #section-campus {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}
body.home-snap #section-campus.snap-section.section:not(.section--breathing) {
  padding-bottom: 2rem;
}
body.home-snap #section-campus .container {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  height: 100%;
  flex-direction: column;
}
body.home-snap #section-campus .section-title-underline {
  flex: 0 0 auto;
  margin-bottom: 0.65rem !important;
}
.facility-grid {
  align-items: stretch;
}
body.home-snap #section-campus .facility-grid-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
}
body.home-snap #section-campus .facility-grid.row {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0;
}
body.home-snap #section-campus .facility-grid {
  align-content: stretch;
  height: 100%;
}
body.home-snap #section-campus .facility-grid > [class*="col-"].mb-4 {
  margin-bottom: 0.5rem !important;
}
#section-campus .campus-home-more-footer {
  margin-top: 1rem;
  padding-top: 0.35rem;
}
body.home-snap #section-campus .campus-home-more-footer {
  flex: 0 0 auto;
  margin-top: auto;
  margin-bottom: 0;
  padding: 0.35rem 0 0;
  background: transparent;
  border: none;
  box-shadow: none;
  position: relative;
  z-index: 2;
}
body.home-snap #section-campus .campus-home-more-btn {
  min-width: 0;
  font-size: 0.8125rem;
  padding: 0.2rem 0.65rem;
  line-height: 1.35;
}
body.home-snap #section-campus .campus-home-more-btn-icon {
  padding: 0.35rem 0.55rem;
  line-height: 1;
}
body.home-snap #section-campus .facility-grid > [class*="col-"] {
  display: flex;
}
.facility-card {
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.facility-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card);
}
body.home-snap #section-campus .facility-card:hover {
  transform: translateY(-2px);
}
.facility-card-img-link {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--bg-placeholder);
  aspect-ratio: 16 / 10;
}
body.home-snap #section-campus .facility-card.d-flex.flex-column {
  width: 100%;
  height: 100%;
  min-height: 0;
}
body.home-snap #section-campus .facility-card-img-link {
  flex: 1 1 auto;
  height: auto !important;
  min-height: clamp(96px, calc((100vh - var(--home-nav-h) - 11rem) / 3), 210px);
  max-height: none;
  aspect-ratio: auto;
}
body.home-snap #section-campus .facility-card-desc {
  display: none;
}
.facility-card-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.facility-card:hover .facility-card-img {
  transform: scale(1.035);
}
.facility-card-body {
  padding: 1rem 1.1rem 1.15rem;
}
body.home-snap #section-campus .facility-card-body {
  flex: 0 0 auto;
  padding: 0.3rem 0.6rem 0.35rem;
}
.facility-card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-hover);
  text-transform: uppercase;
}
body.home-snap #section-campus .facility-card-kicker {
  margin-bottom: 0.12rem;
  font-size: 0.62rem;
  gap: 0.25rem;
}
body.home-snap #section-campus .facility-card-kicker::before {
  width: 0.42rem;
  height: 0.42rem;
  box-shadow: 0 0 0 3px var(--accent-muted);
}
.facility-card-kicker::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-muted);
}
.facility-card-title {
  margin: 0;
  color: var(--ink-900);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
body.home-snap #section-campus .facility-card-title {
  font-size: 0.8rem;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.facility-card-desc {
  margin: 0.55rem 0 0;
  color: var(--ink-600);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Footer 圖示：主色淺藍 */
.footer .fa-icon { color: #6ee7b7; margin-right: 0.5rem; opacity: 0.95; }
.footer-tagline { font-style: italic; font-weight: 600; color: rgba(255,255,255,0.9); }

/* ===== 全球據點頁：配合地圖主視覺 ===== */
.global-map-section {
  padding: 2.5rem 0 3rem;
}
.global-map-card {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
  border: 1px solid var(--border-soft);
  background: #fff;
}
.global-map-img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
}
.global-map-caption {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
}
.global-map-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink-900);
}
.global-map-sub {
  font-size: 0.9rem;
  color: var(--ink-600);
}

.global-legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.global-legend-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.global-legend-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}
.global-legend-item--factory .global-legend-icon {
  background: #dc2626;
}
.global-legend-item--office .global-legend-icon {
  background: var(--accent);
}
.global-legend-item--warehouse .global-legend-icon {
  background: #ea580c;
}
.global-legend-item--rd .global-legend-icon {
  background: #374151;
}
.global-legend-label {
  font-weight: 600;
  color: var(--ink-900);
  font-size: 1rem;
}

.global-service-card {
  padding: 1.75rem 2rem;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: #fff;
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.global-service-card--insurance {
  border-left: 4px solid var(--accent);
}
.global-service-card--cta {
  border-left: 4px solid #059669;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.global-service-card--cta .btn {
  align-self: flex-start;
}


/* ===== Language Switcher ===== */
.navbar-collapse {
  align-items: center;
}
.language-switcher {
  display: inline-flex;
  align-items: center;
  margin-top: 0.85rem;
}
.language-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  min-height: 2.2rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.language-toggle:hover,
.language-toggle:focus,
.language-toggle:focus-visible,
.language-toggle.show {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.6);
}
.language-toggle:focus,
.language-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.16);
}
.language-toggle.dropdown-toggle::after {
  margin-left: 0.35rem;
  vertical-align: 0.08rem;
  border-top-color: currentColor;
}
.language-menu {
  min-width: 0;
  padding: 0.35rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.9rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
}
.language-menu-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.7rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.7rem;
}
.language-menu-item:hover,
.language-menu-item:focus {
  background: rgba(5, 150, 105, 0.08);
}
.language-menu-item.is-current,
.language-menu-item[aria-current="page"] {
  background: rgba(5, 150, 105, 0.14);
}
.flag-icon {
  display: inline-block;
  width: 1.4rem;
  height: 1rem;
  border-radius: 0.18rem;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}
.flag-icon--tw {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20'%3E%3Crect width='28' height='20' fill='%23de2910'/%3E%3Crect width='12' height='10' fill='%23012869'/%3E%3Cg transform='translate(6 5)'%3E%3Ccircle r='1.6' fill='%23fff'/%3E%3Cg stroke='%23fff' stroke-width='1.1'%3E%3Cpath d='M0-4v8M-4 0h8M-2.8-2.8l5.6 5.6M-2.8 2.8l5.6-5.6'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.flag-icon--us {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20'%3E%3Crect width='28' height='20' fill='%23b22234'/%3E%3Cg fill='%23fff'%3E%3Crect y='1.54' width='28' height='1.54'/%3E%3Crect y='4.62' width='28' height='1.54'/%3E%3Crect y='7.7' width='28' height='1.54'/%3E%3Crect y='10.78' width='28' height='1.54'/%3E%3Crect y='13.86' width='28' height='1.54'/%3E%3Crect y='16.94' width='28' height='1.54'/%3E%3C/g%3E%3Crect width='12' height='10.77' fill='%233c3b6e'/%3E%3Cg fill='%23fff'%3E%3Ccircle cx='2' cy='2' r='.6'/%3E%3Ccircle cx='5' cy='2' r='.6'/%3E%3Ccircle cx='8' cy='2' r='.6'/%3E%3Ccircle cx='3.5' cy='4.2' r='.6'/%3E%3Ccircle cx='6.5' cy='4.2' r='.6'/%3E%3Ccircle cx='9.5' cy='4.2' r='.6'/%3E%3Ccircle cx='2' cy='6.4' r='.6'/%3E%3Ccircle cx='5' cy='6.4' r='.6'/%3E%3Ccircle cx='8' cy='6.4' r='.6'/%3E%3Ccircle cx='3.5' cy='8.6' r='.6'/%3E%3Ccircle cx='6.5' cy='8.6' r='.6'/%3E%3Ccircle cx='9.5' cy='8.6' r='.6'/%3E%3C/g%3E%3C/svg%3E");
}
.flag-icon--cn {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20'%3E%3Crect width='28' height='20' fill='%23de2910'/%3E%3Cg fill='%23ffde00'%3E%3Cpath transform='translate(6 5) scale(.42)' d='M0-8 2.35-2.6 8-2.6 3.4.9 5.2 6.8 0 3.6-5.2 6.8-3.4.9-8-2.6-2.35-2.6Z'/%3E%3Cpath transform='translate(12 3) scale(.18) rotate(20)' d='M0-8 2.35-2.6 8-2.6 3.4.9 5.2 6.8 0 3.6-5.2 6.8-3.4.9-8-2.6-2.35-2.6Z'/%3E%3Cpath transform='translate(14 5.3) scale(.18) rotate(40)' d='M0-8 2.35-2.6 8-2.6 3.4.9 5.2 6.8 0 3.6-5.2 6.8-3.4.9-8-2.6-2.35-2.6Z'/%3E%3Cpath transform='translate(14 8.2) scale(.18) rotate(12)' d='M0-8 2.35-2.6 8-2.6 3.4.9 5.2 6.8 0 3.6-5.2 6.8-3.4.9-8-2.6-2.35-2.6Z'/%3E%3Cpath transform='translate(12 10.5) scale(.18) rotate(-12)' d='M0-8 2.35-2.6 8-2.6 3.4.9 5.2 6.8 0 3.6-5.2 6.8-3.4.9-8-2.6-2.35-2.6Z'/%3E%3C/g%3E%3C/svg%3E");
}
.flag-icon--es {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 20'%3E%3Crect width='28' height='20' fill='%23aa151b'/%3E%3Crect y='5' width='28' height='10' fill='%23f1bf00'/%3E%3C/svg%3E");
}

/* ===== Breadcrumb ===== */
.breadcrumb-wrap {
  background: #f6f8fb;
  border-bottom: 1px solid rgba(19, 49, 79, 0.08);
}
.page-breadcrumb {
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}
.page-breadcrumb .breadcrumb-item,
.page-breadcrumb .breadcrumb-item.active {
  color: #5f6e7d;
}
.page-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  color: #8c99a6;
}
.page-breadcrumb a {
  color: #13314f;
  text-decoration: none;
}
.page-breadcrumb a:hover,
.page-breadcrumb a:focus-visible {
  color: var(--accent-hover);
  text-decoration: underline;
}
@media (min-width: 1400px) {
  .language-switcher {
    margin-top: 0;
    margin-left: 0.5rem;
  }
}
@media (max-width: 1399.98px) {
  /* 僅在展開/動畫中套用 flex，避免覆蓋 Bootstrap .collapse 的 display:none */
  .nav-grad .navbar-collapse.show,
  .nav-grad .navbar-collapse.collapsing {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    align-content: flex-start;
    justify-content: flex-start;
    gap: 0.25rem 0.4rem;
  }
  .nav-grad .navbar-collapse.show {
    max-height: calc(100dvh - var(--home-nav-h, 72px) - 0.25rem);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-top: 0.35rem;
    padding-bottom: 0.65rem;
  }
  .nav-grad .navbar-collapse.collapsing {
    overflow: hidden;
  }
  .nav-grad .navbar-collapse.show .navbar-nav,
  .nav-grad .navbar-collapse.collapsing .navbar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 0 !important;
    gap: 0.1rem 0.25rem;
  }
  .nav-grad .navbar-collapse.show .nav-item,
  .nav-grad .navbar-collapse.collapsing .nav-item {
    flex: 0 0 auto;
  }
  .nav-grad .navbar-collapse.show .nav-link,
  .nav-grad .navbar-collapse.collapsing .nav-link {
    white-space: nowrap;
    padding: 0.35rem 0.5rem;
    font-size: 0.92rem;
  }
  .nav-grad .navbar-collapse.show .language-switcher {
    position: static;
    z-index: 1;
    width: auto;
    margin-top: 0;
    margin-left: auto;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    background: none;
    flex-shrink: 0;
    align-self: center;
  }
  .language-toggle {
    min-width: 2.85rem;
  }
  .language-switcher {
    margin-top: 0;
  }
}

@media (max-height: 700px) {
  body.home-snap .hero-stats-combo .hero .container {
    padding-top: 1.1rem !important;
    padding-bottom: 1rem !important;
  }
  body.home-snap .hero-stats-combo .stats-dark {
    padding: 0.85rem 0;
  }
  body.home-snap .hero-stats-combo .stats-dark .stat-num {
    font-size: 1.4rem;
  }
  body.home-snap .hero-stats-combo .hero .display-6 {
    font-size: calc(1.1rem + 1.2vw);
  }
  body.home-snap .hero-stats-combo .hero .pill {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
  }
}

/* 視窗過矮時：停用 snap（避免區塊裁切 / 多重捲軸） */
@media (max-height: 780px) {
  body.home-snap {
    scroll-snap-type: none;
  }
  body.home-snap .snap-section,
  body.home-snap .snap-section.snap-section--free {
    height: auto;
    min-height: 0;
    overflow: visible;
    scroll-snap-align: none;
    scroll-snap-stop: normal;
  }
  body.home-snap .hero-stats-combo {
    overflow: visible;
  }
}
