/* HTI 官網共用樣式
   手機優先：先寫手機版，再用 min-width 往大螢幕加樣式（prototype/PLAN.md 決定事項第 8 條）。
   斷點：600px（平板）、1024px（桌機）。
   顏色、字體沿用 prototype v3。 */

/* ===== 基本設定 ===== */
:root {
  --navy: #132d41;
  --teal: #087f80;
  --teal-dark: #086769;
  --ink: #173346;
  --muted: #4a5a66; /* 說明文字灰色：所有用到的淺色背景對比度都在 6:1 以上（WCAG AA 要求 4.5:1） */
  --line: #dbe5e8;
  --paper: #f5f8f8;
  --focus: #dc981d;
  --header-h: 56px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
[hidden] { display: none !important; }

.wrap { max-width: 1200px; margin: 0 auto; padding-inline: 25px; }

.skip { position: absolute; left: 10px; top: -80px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { top: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 25px;
  border: 1px solid var(--teal); border-radius: 5px;
  background: var(--teal); color: #fff;
  padding: 12px 21px; font-size: 14px; font-weight: 500;
  transition: background .2s, transform .2s;
}
.btn:hover { background: var(--teal-dark); transform: translateY(-2px); }
.btn.outline { background: transparent; color: var(--ink); border-color: #afc2c8; }
.btn-sm { padding: 8px 16px; font-size: 13px; gap: 16px; }

/* ===== 頁首（手機、平板：漢堡選單） ===== */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: #ffffffee;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; }
.brand-logo { display: block; height: 26px; width: auto; }

.menu-toggle {
  display: grid; place-items: center;
  width: 44px; height: 44px; margin-right: -10px;
  background: none; border: 0; border-radius: 6px;
}
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block; width: 22px; height: 2px; border-radius: 2px;
  background: var(--ink); transition: transform .2s, background .2s;
}
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -7px; }
.menu-icon::after { top: 7px; }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateY(-7px) rotate(-45deg); }

.site-nav {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0;
  max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  background: #fff;
  padding: 12px 25px 24px;
  box-shadow: 0 20px 30px #12333322;
  border-bottom: 1px solid var(--line);
}
.site-nav.open { display: flex; flex-direction: column; }
.nav-list, .submenu { list-style: none; margin: 0; padding: 0; }
.nav-list > li > a, .sub-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%; padding: 12px 0; font-size: 15px; font-weight: 500;
  background: none; border: 0; text-align: left;
}
.nav-list > li > a:hover, .sub-toggle:hover, .nav-list a[aria-current="page"] { color: var(--teal); }
.sub-toggle svg { width: 10px; height: 10px; transition: transform .2s; }
.has-sub.open .sub-toggle svg { transform: rotate(180deg); }
.submenu { display: none; margin: 0 0 8px 4px; padding-left: 12px; border-left: 2px solid var(--line); }
.has-sub.open > .submenu { display: block; }
.submenu a { display: block; padding: 8px 0; font-size: 14px; color: var(--muted); }
.submenu a:hover { color: var(--teal); }
.lang-link { padding: 12px 0; font-size: 15px; color: var(--muted); }
.lang-link:hover { color: var(--teal); }
.site-nav .btn { align-self: flex-start; margin-top: 12px; }

/* ===== 頁尾：一行精簡公司資訊；放不下時自動換行（手機約 2～3 行） ===== */
.site-footer { border-top: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: 12px; line-height: 1.6; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; padding-top: 16px; padding-bottom: 16px; }
.footer-logo { display: block; height: 22px; width: auto; }
.footer-info { display: contents; font-style: normal; }
.site-footer a { color: var(--ink); }
.site-footer a:hover { color: var(--teal); text-decoration: underline; }
.copyright { margin: 0; }

/* ===== 平板（600px 以上） ===== */
@media (min-width: 600px) {
  .site-nav { padding: 12px 25px 24px; }
}

/* ===== 桌機（1024px 以上：選單橫排、下拉選單） ===== */
@media (min-width: 1024px) {
  :root { --header-h: 64px; }
  /* 頁尾在一行內，用「｜」分隔 */
  .footer-inner { flex-wrap: nowrap; gap: 0; }
  .footer-info > span::before, .copyright::before { content: "｜"; margin: 0 10px; color: var(--line); }
  .footer-info > span:first-child::before { content: ""; margin: 0 0 0 14px; }
  .copyright { margin-left: auto; }
  .copyright::before { display: none; }
  .wrap { padding-inline: 36px; }
  .brand-logo { height: 30px; }
  .menu-toggle { display: none; }
  .site-nav {
    display: flex; flex-direction: row; align-items: center; gap: 24px;
    position: static; max-height: none; overflow: visible;
    background: none; padding: 0; box-shadow: none; border: 0;
  }
  .nav-list { display: flex; align-items: center; gap: 24px; }
  .nav-list > li > a, .sub-toggle { width: auto; padding: 8px 0; font-size: 14px; }
  .has-sub { position: relative; }
  .submenu {
    display: none; position: absolute; top: calc(100% + 10px); left: -16px; min-width: 210px;
    margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px;
    background: #fff; box-shadow: 0 18px 40px #183a5018; z-index: 30;
  }
  .submenu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
  .submenu a { padding: 8px 12px; border-radius: 5px; color: var(--ink); white-space: nowrap; }
  .submenu a:hover { background: var(--paper); }
  .has-sub:hover > .submenu, .has-sub:focus-within > .submenu, .has-sub.open > .submenu { display: block; }
  .lang-link { padding: 8px 0; font-size: 14px; }
  .site-nav .btn { margin-top: 0; }
}

/* =====================================================================
   首頁（設計照 prototype v3；手機優先改寫，斷點 600／1024）
   ===================================================================== */
h1, h2 { font-weight: 700; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 2px; color: var(--teal); margin: 0 0 20px; }
.tag { font-size: 10px; letter-spacing: 1.6px; color: var(--teal); font-weight: 700; }
.lead { font-size: 16px; font-weight: 400; color: var(--muted); max-width: 480px; }
.micro { font-size: 12px; color: var(--muted); }
.text-link { color: var(--teal); font-size: 14px; font-weight: 500; margin-top: auto; display: flex; justify-content: space-between; }

/* ----- 第一屏（手機、平板：圖上文下，圖只裁出手和 AI 晶片） ----- */
.hero3 { position: relative; overflow: hidden; background: #f6f9f9; }
.hero3-media { position: relative; overflow: hidden; aspect-ratio: 460 / 297; }
/* 圖片層：只有這一層會動，10 秒內從 1 拉近到 1.05（以左側中間為基準），之後停住 */
.hero3-img {
  position: absolute; inset: 0;
  transform-origin: left center;
  animation: hero3-zoom 10s cubic-bezier(.22, 1, .36, 1) both;
  will-change: transform;
}
@keyframes hero3-zoom { from { transform: scale(1); } to { transform: scale(1.05); } }
/* 手機、平板：裁切範圍 x 0–46%、y 28–80%（同 v3 的 background-size 217.4%、position 0% 58.3%） */
.hero3-img img {
  position: absolute; left: 0; top: 58.3%;
  width: 217.4%; max-width: none; height: auto;
  transform: translateY(-58.3%);
}
.hero3-text { position: relative; padding: 34px 25px 42px; }
.hero3-copy { position: relative; isolation: isolate; }
.hero3-company { font-size: clamp(48px, 5.5vw, 88px); font-weight: 700; color: var(--teal); letter-spacing: .06em; line-height: 1.12; margin: 0; }
.hero3-company-en { font-size: clamp(15px, 1.2vw, 20px); font-weight: 400; color: #3f5361; letter-spacing: .08em; line-height: 1.4; margin: clamp(12px, 1.2vw, 18px) 0 clamp(26px, 3vw, 46px); }
.hero3-tagline { font-size: clamp(22px, 2.2vw, 34px); font-weight: 500; color: var(--ink); line-height: 1.4; letter-spacing: .01em; margin: 0 0 clamp(14px, 1.4vw, 22px); }
.hero3 .lead { color: #33475a; }
.hero3 .micro { color: #2e4352; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0; }

/* ----- 區塊共用 ----- */
.section { padding: 58px 0; }
.section h2 { font-size: 29px; line-height: 1.4; letter-spacing: -1px; margin: 0; }
.section-head { margin-bottom: 35px; }
/* 區塊標題上方的英文小字（eyebrow）也是 .section-head p，會套到灰色 14px（同 v3） */
.section-head p { color: var(--muted); font-size: 14px; font-weight: 400; max-width: 360px; margin: 16px 0 0; }
.section-head .eyebrow { margin-bottom: 12px; }
.tinted { background: var(--paper); }

/* ----- 產品與方案卡片（手機：一欄，圖上文下） ----- */
.cards { display: grid; grid-template-columns: 1fr; gap: 20px; }
.card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.visual { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: #eef4f4; }
.visual img { display: block; }
.visual.photo img { width: 100%; height: 100%; object-fit: cover; }
.visual.product { display: grid; place-items: center; background: linear-gradient(135deg, #a9a9ad 0%, #c8c8cd 45%, #ebebf0 100%); }
.visual.product img { width: 75%; height: auto; max-height: 88%; object-fit: contain; filter: drop-shadow(0 14px 18px rgba(20, 40, 50, .28)); }
.card-body { padding: 25px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 22px; font-weight: 500; margin: 8px 0; }
.card p { font-size: 14px; font-weight: 400; color: var(--muted); margin: 0 0 20px; }
/* 整張卡片可點擊（首頁產品與方案）：連結的 ::after 蓋滿卡片；滑過時外框變色、圖片微放大，鍵盤聚焦時整張卡片顯示外框 */
.card-linked { position: relative; transition: border-color .2s, box-shadow .2s; }
.card-linked .text-link::after { content: ""; position: absolute; inset: 0; }
.card-linked .text-link:focus-visible { outline: none; }
.card-linked:has(.text-link:focus-visible) { outline: 3px solid var(--focus); outline-offset: 4px; }
.card-linked .visual img { transition: transform .3s; }
@media (hover: hover) {
  .card-linked:hover { border-color: var(--teal); box-shadow: 0 12px 30px #102b3c1a; }
  .card-linked:hover .visual img { transform: scale(1.03); }
}

/* ----- 應用場景 ----- */
.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.tab { padding: 9px 22px; border: 1px solid var(--line); border-radius: 30px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 500; transition: border-color .2s, color .2s, background .2s; }
.tab:hover { border-color: var(--teal); color: var(--teal); }
.tab[aria-selected="true"], .tab[aria-selected="true"]:hover { background: var(--teal); border-color: var(--teal); color: #fff; }
.application { display: grid; grid-template-columns: 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.scene { position: relative; min-height: 270px; overflow: hidden; background: var(--navy); }
.scene-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
/* 底部深色漸層，讓說明小字看得清楚 */
.scene::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 110px; pointer-events: none;
  background: linear-gradient(0deg, rgba(8, 22, 32, .85) 0%, rgba(8, 22, 32, .62) 35%, rgba(8, 22, 32, .24) 70%, rgba(8, 22, 32, 0) 100%); }
.scene-caption { position: absolute; left: 25px; bottom: 15px; z-index: 1; font-size: 11px; color: #eef4f6; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
/* 有指定保留範圍的分頁（data-keep，例如智慧製造、智慧騎乘）：放得下時 cover 填滿，否則改 contain，
   背後墊同一張圖的模糊版（JS 依寬度判斷）；說明小字改成深色標籤，放在圖片實際顯示範圍的右下角 */
.application[data-keep] .scene::after { display: none; }
.application[data-keep].fit-contain .scene-img { object-fit: contain; }
.scene-blur { position: absolute; inset: -24px; background-size: cover; background-position: center; filter: blur(14px) brightness(.72); display: none; }
.application[data-keep].fit-contain .scene-blur { display: block; }
.application[data-keep] .scene-caption { background: rgba(8, 22, 32, .72); color: #fff; padding: 3px 9px; border-radius: 4px; text-shadow: none; }
.app-text { padding: 26px; }
.app-text h3 { font-size: 26px; font-weight: 500; margin: 0 0 16px; }
.app-text p { font-size: 15px; font-weight: 400; color: var(--muted); }
.app-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 25px 0; }
.app-list span { background: #edf5f3; color: #356962; border-radius: 4px; font-size: 12px; padding: 5px 10px; }
.app-text .app-more { margin-bottom: 14px; }

/* ----- 研發團隊 ----- */
.expertise { display: grid; grid-template-columns: 1fr; gap: 40px; }
.expertise p { color: var(--muted); font-size: 15px; font-weight: 400; }
.about-link { max-width: 220px; }
.capabilities { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
/* 英文：「Application‑Focused」用不換行連字號，能力區太窄時兩欄會把右欄撐寬、左欄被壓窄，
   所以手機和平板（1023px 以下，平板時能力區在文字右邊、寬度只有一半）改成一欄，1024px 以上才兩欄 */
.capabilities:lang(en) { grid-template-columns: 1fr; }
@media (min-width: 1024px) { .capabilities:lang(en) { grid-template-columns: 1fr 1fr; } }
.capability { border-top: 2px solid #a1c9c2; padding: 17px 0; }
.capability strong { font-size: 18px; font-weight: 500; }
.capability p { font-size: 13px; margin: 8px 0; }
.process { margin-top: 55px; padding-top: 25px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.process span { color: var(--teal); font-size: 12px; }
.process h3 { font-size: 16px; font-weight: 500; margin: 8px 0; }

/* ----- 聯絡表單 ----- */
.contact { background: var(--navy); color: #fff; }
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 40px; }
.contact .eyebrow { color: #8fd1c4; }
.contact h2 { font-size: 31px; }
.contact p { color: #bbccd4; font-size: 15px; font-weight: 400; }
/* 左欄精簡聯絡資訊 */
.contact-brief { list-style: none; margin: 28px 0 0; padding: 20px 0 0; border-top: 1px solid #ffffff22; display: grid; gap: 10px; font-size: 14px; }
.contact-brief li { display: grid; grid-template-columns: 4.5em 1fr; gap: 12px; }
.contact-brief span { color: #8fd1c4; }
.contact-brief a { color: #fff; }
.contact-brief a:hover { text-decoration: underline; }

/* 洽詢表單（深色背景） */
.inquiry { display: grid; grid-template-columns: 1fr; gap: 16px; }
.inquiry .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.inquiry label { color: #dfe9ee; }
.inquiry .req { color: #9bddcd; }
.inquiry input:not([type="checkbox"]), .inquiry select, .inquiry textarea {
  font: inherit; font-size: 15px; width: 100%; min-width: 0; padding: 10px 12px;
  border: 1px solid #65808e; border-radius: 4px; background: #ffffff0d; color: #fff;
}
.inquiry select option { color: var(--ink); }
.inquiry textarea { resize: vertical; min-height: 110px; }
.inquiry input::placeholder, .inquiry textarea::placeholder { color: #a2b4bf; }
.inquiry input:focus-visible, .inquiry select:focus-visible, .inquiry textarea:focus-visible { outline: 2px solid #9bddcd; outline-offset: 1px; border-color: #9bddcd; }
.inquiry [aria-invalid="true"] { border-color: #ffb4a8; }
/* 錯誤、狀態訊息是 <p>，要比 .contact p 優先 */
.inquiry .field-error { margin: 0; font-size: 13px; color: #ffb4a8; }
.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.6; cursor: pointer; }
.checkbox input { flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: #9bddcd; }
.inquiry .btn { justify-self: start; align-self: flex-start; background: #9bddcd; color: #153d40; border-color: #9bddcd; }
.inquiry .btn:disabled { opacity: .65; cursor: progress; transform: none; }
.inquiry .form-status { margin: 4px 0 0; padding: 12px 14px; border-radius: 6px; font-size: 14px; line-height: 1.6; }
.inquiry .form-status.is-success { background: #9bddcd26; color: #c9f2e6; border: 1px solid #9bddcd66; }
.inquiry .form-status.is-error { background: #ffb4a81f; color: #ffd3cc; border: 1px solid #ffb4a866; }
/* 防機器人欄位：完全隱藏 */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ----- 對話框 ----- */
dialog { border: 0; border-radius: 12px; padding: 35px; max-width: 560px; width: calc(100% - 40px); color: var(--ink); box-shadow: 0 25px 100px #0003; }
dialog::backdrop { background: #102b3c99; }
.close { float: right; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #edf3f3; font-size: 20px; }

/* ----- 首頁：平板（600px 以上） ----- */
@media (min-width: 600px) {
  .section { padding: 92px 0; }
  .section h2 { font-size: 34px; }
  .section-head { display: flex; justify-content: space-between; align-items: end; gap: 40px; }
  .section-head p { margin: 0; }
  .section-head .eyebrow { margin-bottom: 0; }
  /* 產品卡片：一欄，三張上下排列；圖片在左（約 40% 寬，4:3），文字在右 */
  .card { flex-direction: row; }
  .card .visual { flex: 0 0 40%; align-self: flex-start; }
  .application { grid-template-columns: 1.05fr 1fr; }
  .scene { min-height: 315px; }
  .app-text { padding: 38px; }
  .expertise { grid-template-columns: 1fr 1fr; }
  .process { grid-template-columns: repeat(4, 1fr); }
  .contact-grid { grid-template-columns: .9fr 1fr; }
  .contact h2 { font-size: 36px; }
  .inquiry { grid-template-columns: 1fr 1fr; gap: 16px 17px; }
  .inquiry .field.full { grid-column: 1 / -1; }
}

/* ----- 首頁：桌機（1024px 以上） ----- */
@media (min-width: 1024px) {
  /* 第一屏：圖片滿版，文字在右；高度跟著圖片比例，最高一個螢幕減掉頁首 */
  .hero3 { display: flex; align-items: center; background: #dfe9f0;
    height: max(440px, 27vw, min(calc(100vw * 571 / 1000), calc(100vh - var(--header-h)))); }
  .hero3-media { position: absolute; inset: 0; aspect-ratio: auto; }
  .hero3-img img { top: 0; width: 100%; height: 100%; transform: none; object-fit: cover; object-position: left 54%; }
  /* 右側白色薄霧，最多 35%，手的範圍（拉近後到 42vw）幾乎不遮 */
  .hero3-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg,
    rgba(255,255,255,0) 0, rgba(255,255,255,0) 36vw,
    rgba(255,255,255,.015) 40vw, rgba(255,255,255,.05) 44vw, rgba(255,255,255,.10) 48vw,
    rgba(255,255,255,.16) 52vw, rgba(255,255,255,.22) 57vw, rgba(255,255,255,.27) 62vw,
    rgba(255,255,255,.31) 68vw, rgba(255,255,255,.34) 76vw, rgba(255,255,255,.35) 84vw, rgba(255,255,255,.35) 100%); }
  .hero3-text { width: 100%;
    padding: 0 max(36px, calc((100vw - 1200px) / 2 + 36px)) 0 max(36px, calc((100vw - 1200px) / 2 + 36px), calc(42vw + 40px)); }
  .hero3-copy { max-width: 640px; }
  /* 只在文字後面加柔和的白色光暈 */
  .hero3-copy::before { content: ""; position: absolute; z-index: -1; left: -14%; right: -18%; top: -32%; bottom: -32%;
    background: radial-gradient(closest-side, rgba(255,255,255,.62) 0%, rgba(255,255,255,.5) 35%, rgba(255,255,255,.28) 62%, rgba(255,255,255,.1) 82%, rgba(255,255,255,0) 100%); }
  .cards { grid-template-columns: repeat(3, 1fr); gap: 22px; }
  .card { flex-direction: column; }
  .card .visual { flex: none; align-self: stretch; }
  .expertise { gap: 80px; }
  .contact-grid { gap: 85px; }
}

/* =====================================================================
   產品頁（手機優先；1024px 以上圖文左右交替）
   ===================================================================== */
/* 有產品分類標籤列的頁面：錨點跳轉時要再讓出標籤列的高度 */
html:has(.subnav) { scroll-padding-top: calc(var(--header-h) + 64px); }

.page-hero { background: radial-gradient(ellipse at 90% 20%, #e1f1ee, transparent 60%), #f6f9f9; padding: 44px 0 36px; }
.page-hero h1 { font-size: 36px; line-height: 1.3; letter-spacing: -1px; margin: 0 0 12px; }
/* 英文小標和首頁各區塊一致：灰色細字 */
.page-hero .eyebrow { margin-bottom: 12px; color: var(--muted); font-size: 15px; font-weight: 400; }
.page-hero .lead { margin: 0; }

/* 產品分類標籤列：固定在頁首下方，手機可左右滑動 */
.subnav { position: sticky; top: var(--header-h); z-index: 15; background: #ffffffee; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.subnav ul { list-style: none; margin: 0; padding: 10px 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.subnav ul::-webkit-scrollbar { display: none; }
.subnav a { display: block; white-space: nowrap; padding: 7px 16px; border: 1px solid var(--line); border-radius: 30px; background: #fff; font-size: 13px; font-weight: 500; transition: border-color .2s, color .2s, background .2s; }
.subnav a:hover { border-color: var(--teal); color: var(--teal); }
.subnav a[aria-current="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }

.legacy-anchor { display: block; height: 0; }
.product-block { padding: 56px 0; }
.product-intro { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
.product-media { border-radius: 12px; overflow: hidden; background: #eef4f4; }
.product-media img { display: block; width: 100%; height: auto; }
.product-figure .zoom-trigger { border-radius: 12px; }
/* 主圖＋產品特寫（門禁機）：手機版特寫放在主圖下方左側 */
.product-media.has-inset { overflow: visible; border-radius: 0; background: none; }
.has-inset .media-main { border-radius: 12px; }
.has-inset .media-inset { width: 120px; height: auto; margin-top: 12px; border: 4px solid #fff; border-radius: 8px; box-shadow: 0 8px 22px rgba(19, 45, 65, .22); background: #fff; }
.product-text h2 { font-size: 29px; line-height: 1.35; letter-spacing: -.5px; margin: 0 0 8px; }
.product-text > p { color: var(--muted); font-size: 15px; font-weight: 400; }
.product-text .product-subtitle { color: var(--ink); font-size: 18px; font-weight: 500; margin: 0 0 12px; }
.product-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.product-actions .btn { gap: 14px; }
.feature-list { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 16px; }
.feature-list li { padding-left: 16px; border-left: 2px solid #a1c9c2; }
.feature-list strong { display: block; font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.feature-list span { display: block; color: var(--muted); font-size: 14px; font-weight: 400; }
.check-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.check-list li { position: relative; padding-left: 26px; }
.check-list li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 12px; height: 7px; border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal); transform: rotate(-45deg); }
.function-list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; font-size: 13px; font-weight: 500; }
.function-list img { display: block; width: 44px; height: auto; margin: 0 auto 6px; }
/* 視覺控制系統 VCS：適用範圍、運作方式（四個圖示＋流程圖）、規格表下方小字 */
.product-scope { margin: 18px 0 0; font-size: 14px; font-weight: 400; color: var(--muted); }
.product-scope strong { display: block; color: var(--ink); font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.how-block { margin-top: 48px; }
.how-block h3 { font-size: 18px; font-weight: 500; margin: 0 0 18px; }
.step-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; }
.step-list li { display: flex; flex-direction: column; align-items: center; text-align: center; }
.step-list img { display: block; width: 44px; height: auto; margin-bottom: 8px; }
.step-num { font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--teal); }
.step-list strong { font-size: 15px; font-weight: 500; margin: 2px 0 4px; }
.step-desc { font-size: 13px; font-weight: 400; color: var(--muted); line-height: 1.6; }
/* 流程圖：手機版維持最小寬度，可以左右滑動 */
.flow-scroll { margin-top: 32px; overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
/* 中文流程圖改用網站字型（Noto Sans TC）；英文版維持 SVG 原本設計用的字型（Noto Sans／Arial），
   Noto Sans TC 的英文字比較寬，方框裡的字會碰到邊 */
.flow-scroll svg { display: block; width: 100%; min-width: 720px; height: auto; font-family: inherit; }
.flow-scroll svg:lang(en) { font-family: "Noto Sans", Arial, sans-serif; }
.spec-note { margin: 10px 0 0; font-size: 12px; font-weight: 400; color: var(--muted); }
#vcs .product-actions { margin-top: 28px; }

/* 小節標題（No code AI 工具） */
.sub-head { margin: 48px 0 20px; }
.sub-head h3 { font-size: 22px; font-weight: 500; margin: 0 0 4px; }
.sub-head p { color: var(--muted); font-size: 14px; font-weight: 400; margin: 0; }

/* AI 工具卡（手機：圖上文下；平板：圖左文右；桌機：2×2） */
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.tool-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.tool-visual { aspect-ratio: 16 / 10; background: #eef4f4; display: grid; place-items: center; }
.tool-visual img { display: block; width: 92%; height: 92%; object-fit: contain; }
.tool-body { padding: 22px 25px 25px; display: flex; flex-direction: column; flex: 1; }
.tool-name { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 1.2px; color: var(--teal); text-transform: uppercase; }
.tool-body h4 { font-size: 20px; font-weight: 500; margin: 6px 0; }
.tool-body p { color: var(--muted); font-size: 14px; font-weight: 400; margin: 0; }
.tool-body .product-actions { margin-top: auto; padding-top: 18px; }

/* 規格卡（硬體需求） */
.spec-cards { margin-top: 32px; padding: 24px 25px; border-radius: 10px; background: var(--paper); }
.spec-cards h3, .spec-block h3 { font-size: 18px; font-weight: 500; margin: 0 0 14px; }
.spec-cards dl { margin: 0; display: grid; grid-template-columns: 1fr; gap: 14px; }
.spec-cards dt { font-size: 12px; color: var(--teal); font-weight: 700; letter-spacing: 1px; }
.spec-cards dd { margin: 2px 0 0; font-size: 14px; }

/* 規格表 */
.spec-block { margin-top: 36px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.spec-table th, .spec-table td { text-align: left; vertical-align: top; padding: 12px 16px; border-top: 1px solid var(--line); }
.spec-table tr:first-child th, .spec-table tr:first-child td { border-top: 0; }
.spec-table th { width: 7.5em; font-weight: 500; color: var(--ink); background: #f3f7f7; white-space: nowrap; }
.spec-table td { color: #33475a; font-weight: 400; overflow-wrap: anywhere; }
/* 英文規格名稱較長（Temperature accuracy 等）：欄寬加大、可以換行 */
.spec-table:lang(en) th { width: 10em; white-space: normal; }
.spec-columns { display: grid; grid-template-columns: 1fr; gap: 28px; }
.spec-details summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.spec-details summary::-webkit-details-marker { display: none; }
.spec-details summary::after { content: ""; width: 9px; height: 9px; margin: 0 6px 14px 0; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); transition: transform .2s; }
.spec-details[open] summary::after { transform: rotate(-135deg); margin-bottom: 8px; }

/* i350 五項特色 */
.feature-grid { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 16px; }
.feature-grid li { border-top: 2px solid #a1c9c2; padding-top: 14px; }
.feature-grid strong { display: block; font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.feature-grid span { display: block; color: var(--muted); font-size: 13px; font-weight: 400; overflow-wrap: anywhere; }

/* 可點開放大的圖片 */
.zoom-gallery { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 40px; }
.zoom-figure { margin: 0; }
.zoom-wide { margin-top: 20px; }
.zoom-trigger { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; cursor: zoom-in; }
.zoom-trigger img { display: block; width: 100%; height: auto; transition: transform .3s; }
.zoom-trigger:hover img { transform: scale(1.02); }
.zoom-badge { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(19, 45, 65, .78); color: #fff; }
.zoom-badge svg { width: 18px; height: 18px; }
.zoom-figure figcaption { margin-top: 8px; font-size: 13px; font-weight: 500; color: var(--ink); }

/* 放大檢視：手機、平板用原圖尺寸，可上下左右滑動；桌機縮到整個畫面 */
.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border-radius: 0; background: #0d1d29f2; color: #fff; overflow: hidden; }
.lightbox::backdrop { background: #0d1d29cc; }
.lightbox[open] { display: flex; flex-direction: column; }
.lightbox .close { position: absolute; top: 12px; right: 12px; z-index: 2; float: none; width: 40px; height: 40px; background: #ffffffe6; color: var(--ink); font-size: 24px; }
.lightbox-body { flex: 1; overflow: auto; padding: 64px 16px 8px; -webkit-overflow-scrolling: touch; }
.lightbox-body img { display: block; max-width: none; height: auto; margin: 0 auto; background: #fff; border-radius: 6px; }
.lightbox-caption { margin: 0; padding: 8px 16px 16px; text-align: center; font-size: 14px; color: #dfe9ee; }

@media (min-width: 600px) {
  .page-hero { padding: 56px 0 44px; }
  .page-hero h1 { font-size: 42px; }
  .product-block { padding: 80px 0; }
  .product-text h2 { font-size: 32px; }
  .tool-card { flex-direction: row; }
  .tool-visual { flex: 0 0 40%; align-self: stretch; aspect-ratio: auto; min-height: 200px; }
  .spec-cards dl { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 28px; }
  .zoom-gallery { grid-template-columns: repeat(3, 1fr); }
  .zoom-gallery.showcase { grid-template-columns: 1.824fr 1.335fr; }
  .function-list { max-width: 420px; }
  .step-list { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .product-media.has-inset { position: relative; }
  .has-inset .media-inset { position: absolute; right: 3%; bottom: 5%; width: 25%; margin: 0; }
  #vcs .media-inset { bottom: 3%; } /* VCS 主圖右下的治具腳比較低，放大框往下移一點 */
}

@media (min-width: 1024px) {
  html:has(.subnav) { scroll-padding-top: calc(var(--header-h) + 66px); }
  .page-hero { padding: 72px 0 52px; }
  .page-hero h1 { font-size: 48px; }
  .product-block { padding: 96px 0; }
  .product-intro { grid-template-columns: 1fr 1fr; gap: 64px; }
  .product-intro.reverse .product-media, .product-intro.reverse .product-figure { order: 2; }
  /* 圖說不計入高度，讓圖片本身和文字垂直置中 */
  .product-figure .zoom-figure { position: relative; }
  .product-figure figcaption { position: absolute; top: 100%; left: 0; }
  .product-text h2 { font-size: 34px; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .tool-card { flex-direction: column; }
  .tool-visual { flex: none; aspect-ratio: 16 / 10; min-height: 0; }
  .feature-grid { grid-template-columns: repeat(5, 1fr); gap: 24px; }
  .spec-columns { grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
  .lightbox-body { display: grid; place-items: center; padding: 64px 40px 8px; }
  .lightbox-body img { max-width: 100%; max-height: calc(100dvh - 130px); width: auto !important; }
}

/* =====================================================================
   服務內容頁（手機優先）：卡片沿用首頁 .card（手機圖上文下、平板圖左文右）
   ===================================================================== */
.service-items { padding-top: 40px; }
.service-cards .card h3 { font-size: 20px; line-height: 1.45; }
.service-cards .check-list { margin-top: 8px; font-size: 14px; }
.field-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: center; font-size: 16px; font-weight: 500; line-height: 1.45; }
.field-tile svg { width: 36px; height: 36px; color: var(--teal); }

@media (min-width: 600px) {
  .service-items { padding-top: 56px; }
  .field-grid { gap: 20px; }
  .field-tile { padding: 20px 14px; font-size: 17px; }
  .field-tile svg { width: 40px; height: 40px; }
}

@media (min-width: 1024px) {
  /* 五張卡片：三欄，第二排兩張置中 */
  .service-items { padding-top: 64px; }
  .service-cards { display: flex; flex-wrap: wrap; justify-content: center; }
  .service-cards .card { flex: 0 0 calc((100% - 44px) / 3); }
  .field-grid { grid-template-columns: repeat(4, 1fr); gap: 22px; }
  .field-tile { padding: 24px 16px; gap: 10px; }
}

/* =====================================================================
   關於Hti 頁（手機優先）：公司簡介 → 聯絡資訊（深藍）→ 共用洽詢表單（接在一起）
   ===================================================================== */
.about-intro { padding-top: 40px; }
.about-grid { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
/* 手機：直式大樓照裁成 4:3，保留玻璃帷幕；平板以上完整顯示 3:4 */
.about-photo { border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; background: #eef4f4; }
.about-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.about-text h2 { margin-bottom: 16px; }
.about-text p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.9; }
.about-text p + p { margin-top: 1em; }

/* 聯絡資訊：沿用 .contact 的深藍底，下方的洽詢表單（.contact-joined）以細線分隔 */
.contact-info-block { padding-bottom: 40px; }
.contact-info-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
.contact-list { margin: 24px 0 0; display: grid; gap: 14px; font-size: 15px; }
.contact-list div { display: grid; grid-template-columns: 4.5em 1fr; gap: 12px; }
.contact-list dt { color: #8fd1c4; }
.contact-list dd { margin: 0; color: #fff; }
.contact-list a { color: #fff; }
.contact-list a:hover { text-decoration: underline; }
.contact-map iframe { display: block; width: 100%; height: 300px; border: 0; border-radius: 10px; background: #1c3a50; }
.map-link { display: inline-block; margin-top: 10px; padding: 6px 0; font-size: 14px; color: #8fd1c4; }
.map-link:hover { text-decoration: underline; }
.contact-joined { padding-top: 0; }
.contact-joined .contact-grid { border-top: 1px solid #ffffff22; padding-top: 40px; }

@media (min-width: 600px) {
  .about-intro { padding-top: 56px; }
  /* 平板：照片在左（約 40%），文字在右 */
  .about-grid { grid-template-columns: 2fr 3fr; gap: 36px; }
  .about-photo { aspect-ratio: 3 / 4; }
  .contact-info-block { padding-bottom: 56px; }
  .contact-map iframe { height: 340px; }
  .contact-joined .contact-grid { padding-top: 56px; }
}

@media (min-width: 1024px) {
  .about-intro { padding-top: 64px; }
  .about-grid { grid-template-columns: 1fr 1.4fr; gap: 72px; }
  .about-photo { max-width: 440px; }
  .about-text p { font-size: 17px; }
  .contact-info-grid { grid-template-columns: .9fr 1fr; gap: 85px; align-items: start; }
  .contact-info-block { padding-bottom: 64px; }
  .contact-map iframe { height: 360px; }
  .contact-joined .contact-grid { padding-top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero3-img { animation: none; transform: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* =====================================================================
   404 頁（手機優先）：標題區＋兩顆按鈕，下方列出主要頁面
   ===================================================================== */
.not-found { padding-bottom: 48px; }
.not-found-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.not-found-links { padding: 40px 0 64px; }
.not-found-links h2 { font-size: 20px; letter-spacing: 0; margin-bottom: 16px; }
.not-found-links ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 12px; }
.not-found-links a { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-weight: 500; text-decoration: none; }
.not-found-links a:hover { border-color: var(--teal); color: var(--teal); }

@media (min-width: 600px) {
  .not-found { padding: 72px 0 56px; }
  .not-found-links ul { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

@media (min-width: 1024px) {
  .not-found { padding: 96px 0 64px; }
  .not-found-links { padding: 48px 0 96px; }
  .not-found-links ul { max-width: 840px; }
}
