/* ==========================================================================
   泓晏科技 Blue-Chip｜靜態官網樣式
   白底、黑色頁首（白字）、紅色強調色、卡片式區塊、虛線圖片佔位框
   限制不變：不載入任何外部資源（無 webfont、無 CDN）、無 script、可用嚴格 CSP
   ========================================================================== */

:root {
  --primary: #c11136;
  --primary-dark: #a00931;
  --ink: #1a1a1a;
  --body: #333333;
  --sub: #444444;
  --muted: #8a8a8a;
  --line: #e5e5e5;
  --line-dashed: #cccccc;
  --surface: #f7f7f7;

  --maxw: 1080px;
  --gut: 20px;
  --head-bg: #111111;

  --f-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei",
    "PingFang TC", "Noto Sans TC", "Heiti TC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--body);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.9;
}

img, svg {
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

h1, h2, h3 {
  color: var(--ink);
  line-height: 1.5;
  font-weight: 700;
  margin: 0 0 .6em;
  text-wrap: balance;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 17px;
}

p {
  margin: 0 0 1em;
}

ul, ol {
  margin: 0 0 1em;
  padding-left: 1.3em;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 10px;
  top: 10px;
  z-index: 20;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--primary);
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
}

main {
  flex: 1 0 auto;
}

/* ---------------------------------------------- 頁首（黑底、白字） */
.site-head {
  flex: none;
  background: var(--head-bg);
}

/* 注意：這個元素同時是 .wrap，橫向內距由 .wrap 提供；
   這裡只能用 padding-top/bottom 長寫法，用 padding 簡寫會把左右內距歸零
   justify-content: center ＋ .brand 的 margin-right: auto →
   選單與品牌同列時靠右（auto 吃掉剩餘空間），選單換到第二列時置中 */
.head-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 24px;
  padding-top: 14px;
  padding-bottom: 13px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-right: auto;
  color: #fff;
}

.brand:hover {
  color: #fff;
  text-decoration: none;
}

/* logo 放在白色小牌上：圖記是深藍＋黑＋紅，直接壓黑底會整塊糊掉 */
.brand-logo {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 25px 10px 10px;
}

.brand-logo img {
  display: block;
  height: 100px;
  width: auto;
  /* 固定比例＝避免載入前後寬度跳動（<source> 換圖時屬性比例會對不上）；
     比例要跟實際圖檔一致，否則圖片會被壓扁；真的對不上時 object-fit 會留白而不是變形 */
  aspect-ratio: 1180 / 851;
  object-fit: contain;
}

.brand-text {
  display: block;
}

.brand-zh {
  display: block;
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.5;
}

.brand-en {
  display: block;
  font-size: 18px;
  letter-spacing: .2em;
  color: rgba(255, 255, 255, .64);
  margin-top: 1px;
  line-height: 1.6;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
}

.site-nav a {
  display: block;
  padding: 4px 12px 8px;
  font-size: 16px;
  color: rgba(255, 255, 255, .84);
  box-shadow: inset 0 -2px 0 transparent;
}

.site-nav a:hover {
  color: #fff;
  text-decoration: none;
}

/* 目前頁：白字＋紅色底線（紅字在黑底對比不足，維持白字） */
.site-nav a[aria-current="page"] {
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--primary);
}

/* -------------------------------------------- 手機版選單（burger，無 JavaScript）
   <details>/<summary> 是瀏覽器原生收合元件：鍵盤 Tab 到、Enter/Space 開合、
   報讀器會唸出展開狀態，而且不需要任何 script（本站 CSP 不允許 inline script）。 */
.nav-mobile {
  display: none;
}

.nav-burger {
  position: absolute;
  top: 0;
  bottom: 0;
  /* 定位基準是 .head-inner 的 padding box（＝整個視窗寬），所以右緣要自己讓出 gutter */
  right: var(--gut);
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 0;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  list-style: none;
}

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

.burger {
  position: relative;
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  transition: background .18s;
}

.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: currentColor;
  transition: transform .18s, top .18s;
}

.burger::before { top: -7px; }
.burger::after { top: 7px; }

.nav-mobile[open] .burger { background: transparent; }
.nav-mobile[open] .burger::before { top: 0; transform: rotate(45deg); }
.nav-mobile[open] .burger::after { top: 0; transform: rotate(-45deg); }

.nav-burger:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

/* 展開後從頁首下緣滿版落下（絕對定位，不會把 header 撐高）
   定位基準是 .head-inner 的 padding box，而 .wrap 在手機版就是整個視窗寬，故 left/right 用 0 即滿版 */
.nav-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 15;
  background: var(--head-bg);
  border-top: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 14px 26px rgba(0, 0, 0, .22);
}

.nav-panel .wrap {
  padding-top: 2px;
  padding-bottom: 10px;
}

.nav-panel a {
  display: block;
  padding: 14px 0;
  font-size: 16px;
  color: rgba(255, 255, 255, .86);
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.nav-panel a:last-child {
  border-bottom: 0;
}

.nav-panel a:hover {
  color: #fff;
  text-decoration: none;
}

.nav-panel a[aria-current="page"] {
  color: #fff;
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--primary);
  padding-left: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .burger, .burger::before, .burger::after { transition: none; }
}

/* ------------------------------------------------------------------ 頁尾 */
.site-foot {
  flex: none;
  margin-top: 52px;
  background: #fff;
  border-top: 1px solid var(--line);
}

/* 同樣是 .wrap：橫向內距交給 .wrap，這裡只給上下內距 */
.foot-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 40px;
  padding-top: 24px;
  padding-bottom: 32px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.85;
}

.foot-inner p {
  margin: 0;
}

.foot-brand {
  color: var(--ink);
  font-weight: 700;
}

.foot-brand span {
  color: var(--sub);
  font-weight: 400;
  margin-left: 10px;
}

/* 欄位用 flex 排列，窄螢幕會自己換行；手機版改成一行一欄 */
.foot-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  margin-top: 2px !important;
}

.foot-fields .k {
  color: var(--muted);
  margin-right: 5px;
}

.foot-fields b {
  color: var(--sub);
  font-weight: 400;
}

.foot-fields .dot {
  color: #d5d5d5;
  margin: 0 10px;
}

.foot-meta {
  text-align: left;
}

.foot-links {
  margin-top: 2px !important;
}

.foot-links .dot {
  color: #d5d5d5;
  margin: 0 9px;
}

.foot-links a {
  color: var(--sub);
}

.foot-links a:hover {
  color: var(--primary);
}

.copy {
  color: #a8a8a8;
}

/* -------------------------------------------------------------- 頁面標題 */
.crumbs {
  font-size: 13px;
  color: var(--muted);
  margin: 24px 0 8px;
}

.crumbs a {
  color: var(--muted);
}

.crumbs a:hover {
  color: var(--primary);
}

.crumbs span {
  margin: 0 7px;
  color: #c9c9c9;
}

.page-head h1 {
  margin: 0 0 20px;
}

.prose p {
  margin: 0 0 1.15em;
}

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

/* ------------------------------------------------------------------ 首頁 */
.kicker {
  font-size: 13px;
  color: var(--muted);
  margin: 26px 0 6px;
}

.hero {
  padding: 0;
}

.hero h1 {
  margin: 0 0 16px;
}

.lead {
  font-size: 16px;
  color: var(--sub);
  margin: 0 0 12px;
}

.meta {
  font-size: 13.5px;
  color: #6f6f6f;
  margin: 0 0 22px;
}

.meta .sep {
  color: #d5d5d5;
  margin: 0 9px;
}

/* ---------------------------------------------------------------- 按鈕 */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
}

.btn {
  display: inline-block;
  padding: 11px 26px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 2px;
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #fff;
}

.btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  text-decoration: none;
}

.btn.ghost {
  background: #fff;
  color: var(--primary);
}

.btn.ghost:hover {
  background: var(--primary);
  color: #fff;
}

/* ---------------------------------------------------------------- 區塊 */
.sec {
  margin: 46px 0 0;
}

.sec>h2 {
  margin: 0 0 20px;
}

.sec-lead {
  font-size: 14.5px;
  color: var(--muted);
  margin: -12px 0 20px;
}

/* 卡片：白底＋1px 邊框＋上方紅色裝飾線 */
.cards {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.cards.stack {
  grid-template-columns: 1fr;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--primary);
  border-radius: 2px;
  padding: 20px 22px 22px;
}

.card h3 {
  margin: 0 0 .5em;
}

.card .no {
  color: var(--primary);
  font-weight: 700;
  margin-right: 8px;
}

.card p {
  font-size: 14.5px;
  color: var(--sub);
  line-height: 1.85;
  margin: 0 0 .8em;
}

.card> :last-child {
  margin-bottom: 0;
}

.card-link {
  border: 0;
  color: var(--ink);
  display: block;
}

.card-link:hover {
  color: var(--ink);
  text-decoration: none;
}

.card-link:hover h3 {
  color: var(--primary);
}

.items {
  list-style: none;
  padding: 0;
  margin: .9em 0 0;
  display: grid;
  gap: 6px 26px;
  font-size: 14px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.items li {
  position: relative;
  padding-left: 14px;
  color: var(--body);
}

.items li::before {
  content: "·";
  position: absolute;
  left: 2px;
  top: 0;
  color: var(--muted);
}

/* 製程：編號卡片 */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
}

.steps li {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--primary);
  border-radius: 2px;
  padding: 18px 20px 20px;
}

.steps h3 {
  font-size: 16px;
  margin: 0 0 .4em;
}

.steps h3 .no {
  color: var(--primary);
  margin-right: 8px;
}

.steps p {
  font-size: 14px;
  color: var(--sub);
  line-height: 1.85;
  margin: 0;
}

/* ---------------------------------------------------------------- 表格 */
.facts {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 14.5px;
}

.facts th, .facts td {
  text-align: left;
  padding: 12px 16px;
  font-weight: 400;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.facts tr:last-child th, .facts tr:last-child td {
  border-bottom: 0;
}

.facts th {
  width: 30%;
  color: var(--muted);
  background: var(--surface);
}

/* ------------------------------------------------------------ 聯絡據點 */
.locations {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.location {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--primary);
  border-radius: 2px;
  padding: 22px 22px 24px;
}

.location h2 {
  font-size: 17px;
  margin: 0 0 14px;
}

.location dl {
  margin: 0;
  display: grid;
  grid-template-columns: 5.4em 1fr;
  gap: 8px 12px;
  font-size: 14px;
}

.location dt {
  color: var(--muted);
}

.location dd {
  margin: 0;
  color: var(--body);
}

.map-link {
  border: 0;
}

/* ------------------------------------------------------------ 圖片位置 */
.figure-row {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 30px 0 0;
}

.ph {
  margin: 0;
}

.ph-box {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed var(--line-dashed);
  border-radius: 2px;
  background: #fcfcfc;
  color: #9a9a9a;
  font-size: 14px;
  padding: 16px;
}

.ph[data-ratio="16:9"] .ph-box {
  aspect-ratio: 16 / 9;
}

.ph[data-ratio="3:2"] .ph-box {
  aspect-ratio: 3 / 2;
}

.ph[data-ratio="4:3"] .ph-box {
  aspect-ratio: 4 / 3;
}

.ph-img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 2px;
}

/* -------------------------------------------------------------- CTA/App */
.cta {
  margin: 46px 0 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 26px 28px 28px;
}

.cta h2 {
  margin: 0 0 .5em;
}

.cta p {
  font-size: 14.5px;
  color: var(--sub);
  max-width: 44em;
}

.cta .actions {
  margin-top: 18px;
}

.app-block {
  margin: 20px 0 0;
  background: #fff;
  border: 1px dashed var(--line-dashed);
  border-radius: 2px;
  padding: 22px 24px;
}

.app-block h2 {
  font-size: 17px;
  margin: 0 0 .4em;
}

.app-block p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.note {
  margin: 36px 0 0;
  padding-top: 18px;
  border-top: 1px dashed var(--line-dashed);
  font-size: 13.5px;
  color: var(--muted);
}

.note a {
  margin-left: 14px;
}

/* ---------------------------------------------------------------- 響應式 */
@media (max-width: 860px) {
  /* 頁首：品牌與 burger 同一列（不再把選單折成第二列） */
  .head-inner {
    padding-right: 66px;
  }

  .site-nav-desktop {
    display: none;
  }

  .nav-mobile {
    display: block;
  }

  /* 100px 的 logo 在手機上會把 header 撐得很高，改為隨視窗縮放 */
  .brand-logo img {
    height: clamp(44px, 15vw, 62px);
  }

  .brand-zh {
    font-size: clamp(17px, 5vw, 22px);
  }

  .brand-en {
    font-size: clamp(11px, 3.2vw, 14px);
  }

  h1, .hero h1 {
    font-size: 26px;
  }

  .cards, .steps, .figure-row, .locations, .cards.stack {
    grid-template-columns: 1fr;
  }

  /* 頁尾：公司資訊與說明分成上下兩塊，中間用線分隔，各自留出內距 */
  .foot-inner {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 26px;
    padding-bottom: 34px;
  }

  .foot-about {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
  }

  .foot-brand span {
    display: block;
    margin-left: 0;
  }

  .foot-fields {
    display: grid;
    gap: 6px;
    margin-top: 12px !important;
  }

  .foot-fields .dot {
    display: none;
  }

  .foot-meta {
    padding-top: 20px;
  }

  .foot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
    margin-top: 12px !important;
  }

  .foot-links .dot {
    display: none;
  }

  .foot-links a {
    padding: 3px 0;
  }

  .copy {
    margin-top: 4px !important;
  }

  .kicker {
    margin-top: 20px;
  }

  .crumbs {
    margin-top: 18px;
  }
}

@media (max-width: 560px) {
  :root {
    --gut: 16px;
  }

  /* 窄版換成寬式 logo-2（<source media> 已換圖），中文公司名收起來：
     公司名在 405–451px 與 ≤350px 這兩個區間會折成兩行，
     與其讓它換行，不如直接用含 BLUECHIPTECH 的橫式 logo。
     名稱改成無障礙隱藏（不是 display:none），報讀器仍唸得出公司名。
     寬式 logo 的比例是 1305:358（約 3.65:1），比例要設對才不會被壓扁。 */
  .brand-logo img {
    height: clamp(46px, 14vw, 58px);
    aspect-ratio: 1305 / 358;
  }

  .brand-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    white-space: nowrap;
    clip-path: inset(50%);
  }

  body {
    line-height: 1.85;
  }

  h1, .hero h1 {
    font-size: 23px;
  }

  h2 {
    font-size: 18px;
  }

  .locations, .items {
    grid-template-columns: 1fr;
  }

  .facts th {
    width: 34%;
  }

  .location dl {
    grid-template-columns: 5em 1fr;
    gap: 6px 10px;
  }
}

/* 極窄手機：burger 只留圖示（logo 大小已由上面的 clamp 處理） */
@media (max-width: 400px) {
  .head-inner {
    padding-right: 52px;
  }

  .burger-label {
    display: none;
  }

  .brand {
    gap: 9px;
  }
}

@media print {
  .site-head, .site-foot, .actions {
    display: none;
  }
}