/* ==========================================================================
   瑋專實業有限公司 官網 v3 — 主樣式表
   設計系統:四段式企業版(台灣企業官網正裝風,參照欣興電子骨相)
   白底版頭 + 影片段 + 白底橫滑產品區 + 黑底聯絡區
   ========================================================================== */

/* ---------- 設計系統變數 ---------- */
:root {
  /* 白底段 */
  --white: #ffffff;
  --off-white: #f7f8fa;
  --ink: #1a2330;          /* 白底段主文字 */
  --ink-sub: #5b6676;      /* 白底段次要文字 */
  --blue: #2e6da4;         /* 白底段藍色點綴(主按鈕/強調) */
  --blue-deep: #1f4d79;
  --hairline: #e3e7ed;     /* 白底段分隔線 */

  /* 黑底段(聯絡我們,沿用舊鈦藍電光銀配色) */
  --bg: #10161d;
  --panel: #171f29;
  --panel-2: #131a22;
  --text: #e4e9ef;
  --sub: #8e9aa8;
  --accent: #7fb4d8;
  --accent-soft: rgba(127, 180, 216, .12);
  --line: rgba(127, 180, 216, .35);
  --grad: linear-gradient(115deg, #4a7ba0 0%, #7fb4d8 35%, #cfe7f5 50%, #7fb4d8 65%, #4a7ba0 100%);

  --radius: 8px;
  --radius-card: 18px;     /* v5 服務卡白卡圓角 */
  --radius-photo: 12px;    /* v5 服務卡照片圓角 */
  --card-pad: 14px;        /* v5 服務卡白卡內距(照片完整收在卡內) */
  --maxw: 1180px;
  --maxw-wide: 1600px;
  --nav-h: 126px;
}

/* ---------- Reset & 基礎 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); overflow-x: hidden; }

body {
  background: var(--white);
  color: var(--ink);
  font-family: "Noto Sans TC", system-ui, -apple-system, "Microsoft JhengHei", sans-serif;
  font-weight: 400;
  line-height: 1.8;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
section { position: relative; }
button { font-family: inherit; }
/* hidden 屬性一律真的隱藏(防 .svc-modal 等元件的 display 規則蓋掉 UA 預設) */
[hidden] { display: none !important; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* 流光文字(僅聯絡我們段使用) */
.flow-text {
  background: var(--grad);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: goldflow 5.5s ease-in-out infinite;
}
@keyframes goldflow {
  0%, 100% { background-position: 0% 0; }
  50% { background-position: 100% 0; }
}

/* 滾動進場(收斂版:只淡入,無大位移) */
.reveal {
  opacity: 0;
  transition: opacity .6s ease;
}
.reveal.is-visible { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .flow-text { transition: none; animation: none; opacity: 1; }
}

/* ==========================================================================
   第1段 — 白底版頭(sticky 導航)
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--white);
  border-bottom: 1px solid var(--hairline);
}
.navbar-inner {
  width: 100%;              /* .navbar 是 flex,不撐滿會縮成內容寬擠在中間 */
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
/* v5:版頭改用 logo+中英文名一行橫幅圖(images/logo-title.png);v5r 放大,圖檔重出 701×160 */
.brand-logo {
  height: 72px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 8px;
  margin-left: auto;        /* logo 靠左,導航+洽詢鈕併靠右 */
}
.nav-links a {
  font-size: 18.5px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--ink);
  padding: 13px 22px;
  border-radius: 6px;
  transition: color .2s ease, background .2s ease;
  white-space: nowrap;
}
.nav-links a:hover {
  color: var(--blue);
  background: rgba(46, 109, 164, .07);
}

.nav-call { display: none; margin-left: 20px; }
.nav-call a {
  display: inline-block;
  background: var(--blue);
  color: #ffffff;
  border-radius: 8px;
  padding: 16px 34px;
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: .05em;
  white-space: nowrap;
  transition: background .25s ease, transform .2s ease;
}
.nav-call a:hover {
  background: var(--blue-deep);
  transform: translateY(-1px);
}

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  width: 42px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 110;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  height: 3px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease, background .3s ease;
}
.hamburger.is-open span:nth-child(1) { transform: translateY(10px) rotate(45deg); background: var(--blue); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); background: var(--blue); }

.mobile-menu {
  position: fixed;
  inset: 0;
  top: var(--nav-h);
  background: rgba(255, 255, 255, .98);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
}
.mobile-menu a {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink);
}
.mobile-menu .nav-call { display: block; margin-left: 0; }
.mobile-menu .nav-call a { display: inline-block; margin-top: 8px; }

@media (max-width: 600px) {
  .nav-links, .nav-call { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 520px) {
  :root { --nav-h: 104px; }
  .brand-logo { height: 50px; }
}
@media (min-width: 601px) {
  .nav-links { display: flex; }
  .nav-call { display: block; }
  .hamburger { display: none; }
  .mobile-menu { display: none; }
}

/* ==========================================================================
   第2段 — 影片段
   ========================================================================== */
.video-section {
  width: 100%;
  background: #000;
  overflow: hidden;
  line-height: 0;
}
.brand-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: 70vh;
  object-fit: cover;
}

@media (max-width: 760px) {
  .brand-video { max-height: 48vh; }
}

/* ==========================================================================
   第3段 — 白底產品橫滑區
   ========================================================================== */
.services {
  background: var(--off-white);
  padding: 76px 0 72px;
}

.section-head {
  text-align: center;
  margin-bottom: 44px;
}
.section-title {
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 900;
  letter-spacing: .06em;
  color: var(--ink);
}
/* v5e:標題旁「more →」連結;v5h:改為行內元素,與標題文字對齊基線
   (寬度歸零+相對位移,標題本身仍完整置中,不被連結擠偏) */
.section-more {
  display: inline-block;
  width: 0;
  white-space: nowrap;
  vertical-align: baseline;
  position: relative;
  left: 16px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--accent);
  transition: color .2s ease;
}
.section-more:hover { color: var(--blue); text-decoration: underline; }
.section-title .en {
  display: block;
  font-size: clamp(11px, 1.4vw, 13px);
  font-weight: 500;
  letter-spacing: .3em;
  color: var(--ink-sub);
  margin-top: 10px;
}

/* ---- 橫滑卡片軌道 ---- */
.carousel {
  position: relative;
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 0 64px;
}

.carousel-viewport {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
}
.carousel-viewport::-webkit-scrollbar { display: none; }
.carousel-viewport.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

/* v5:圓角卡——白色大圓角卡完整包住自帶圓角的照片(四周留內距) */
.carousel-track {
  display: flex;
  gap: 24px;
  padding: 10px 0 26px;     /* 上下留給 hover 位移與卡片陰影 */
}

.carousel-card {
  flex: 0 0 calc((100% - 2 * 24px) / 3);
  scroll-snap-align: start;
  display: flex;
}

.card {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: 0 6px 22px rgba(26, 35, 48, .08);
  padding: var(--card-pad) var(--card-pad) 22px;
  cursor: pointer;
  transition: box-shadow .25s ease, transform .25s ease;
}
.card:hover {
  box-shadow: 0 12px 30px rgba(26, 35, 48, .14);
  transform: translateY(-3px);
}
.card:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

/* v5d:直式 4:5 照片框,預設 cover 裁切填滿;照片框自帶圓角與陰影 */
.card-media {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius-photo);
  background: var(--off-white);
  box-shadow: 0 4px 14px rgba(26, 35, 48, .12);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
/* v5g:個別卡片要整張完整顯示(不裁切)時,在 figure 加 class="card-media card-media--contain"
   框改透明、留白即白卡底,照片置中,圓角與陰影改套在照片本身 */
.card-media--contain {
  position: relative;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.card-media--contain img {
  position: absolute;
  inset: 0;
  margin: auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-photo);
  box-shadow: 0 4px 14px rgba(26, 35, 48, .12);
}

.card-body {
  padding: 18px 4px 0;
  text-align: center;
}
.card-body h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--ink);
  line-height: 1.5;
}
.card-tag {
  margin-top: 6px;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: .03em;
  color: var(--blue);
  line-height: 1.6;
}

/* 箭頭 */
.carousel-arrow {
  position: absolute;
  top: 38%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--hairline);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
  box-shadow: 0 4px 14px rgba(26, 35, 48, .08);
}
.carousel-arrow svg { width: 20px; height: 20px; }
.carousel-arrow:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.carousel-arrow--prev { left: 6px; }
.carousel-arrow--next { right: 6px; }
.carousel-arrow[disabled] {
  opacity: .35;
  cursor: default;
  pointer-events: none;
}

/* 圓點指示器 */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 30px;
}
.carousel-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--hairline);
  cursor: pointer;
  padding: 0;
  transition: background .25s ease, transform .25s ease;
}
.carousel-dots button.is-active {
  background: var(--blue);
  transform: scale(1.25);
}

/* 601-900:同樣三欄電腦排法,卡片字級略收 */
@media (min-width: 601px) and (max-width: 900px) {
  .carousel { padding: 0 58px; }
  .carousel-track { gap: 16px; }
  .carousel-card { flex: 0 0 calc((100% - 2 * 16px) / 3); }
  .card { padding: 10px 10px 18px; }
  .card-body h3 { font-size: 16px; }
  .card-tag { font-size: 13.5px; }
}
@media (max-width: 600px) {
  .carousel { padding: 0 14px; }
  .carousel-card { flex: 0 0 82%; }
  .carousel-arrow { display: none; }
  .services { padding: 56px 0 50px; }
}

/* ==========================================================================
   v5e — services.html 九卡全展(電腦三欄,卡片/彈窗沿用首頁)
   ========================================================================== */
.services--page { padding: 64px 0 80px; }
.svc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 24px;
}
.svc-item { display: flex; }
/* v5k:services.html 專用正方形照片框(圖檔為 images/sq/ 個別取景版);首頁維持 4:5 不受影響 */
.svc-grid .card-media { aspect-ratio: 1 / 1; }
@media (min-width: 601px) and (max-width: 900px) {
  .svc-grid { gap: 24px 16px; }
}
@media (max-width: 600px) {
  .services--page { padding: 40px 0 56px; }
  .svc-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ==========================================================================
   v5 — ISO 信任帶(影片段與服務項目之間,深底白字滿版)
   ========================================================================== */
.trust-band {
  background: var(--bg);
  color: #ffffff;
  padding: 64px 0 60px;
  text-align: center;
  overflow: hidden;
}
.trust-band::before {      /* 頂部鈦銀流光線,與 footer 呼應 */
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad);
  background-size: 220% 100%;
  animation: goldflow 7s ease-in-out infinite;
}
.trust-stats {
  display: flex;
  justify-content: center;
  align-items: stretch;
}
.trust-stat {
  padding: 0 clamp(32px, 6vw, 80px);
}
.trust-stat + .trust-stat {
  border-left: 1px solid var(--line);
}
.trust-big {
  font-size: clamp(44px, 6.4vw, 72px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: .04em;
  color: #ffffff;
}
.trust-label {
  margin-top: 10px;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 700;
  letter-spacing: .2em;
  color: #ffffff;
}
.trust-rule {
  display: block;
  width: 72px;
  height: 3px;
  margin: 34px auto 26px;
  border-radius: 2px;
  background: var(--accent);
}
.trust-promise {
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 700;
  letter-spacing: .14em;
  color: #ffffff;
}
.trust-promise i {
  font-style: normal;
  color: var(--accent);
  margin: 0 .2em;
}

@media (max-width: 600px) {
  .trust-band { padding: 48px 0 46px; }
  .trust-stats { flex-direction: column; gap: 22px; }
  .trust-stat { padding: 0; }
  .trust-stat + .trust-stat { border-left: 0; border-top: 1px solid var(--line); padding-top: 22px; }
  .trust-big { font-size: 44px; }
  .trust-promise { font-size: 19px; letter-spacing: .06em; }
  .trust-promise i { margin: 0; }
}

/* ==========================================================================
   v5 — 服務項目彈窗
   ========================================================================== */
.svc-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.svc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 22, 29, .72);
}
.svc-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 34px 36px 30px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.svc-modal-dialog:focus { outline: none; }
.svc-modal-title {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: .04em;
  color: var(--ink);
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 3px solid var(--accent);
}
.svc-modal-media {
  border-radius: var(--radius-photo);
  overflow: hidden;
  background: var(--off-white);
}
.svc-modal-media img {
  width: 100%;
  max-height: 52vh;
  object-fit: contain;
  margin: 0 auto;
}
.svc-modal-text {
  margin-top: 22px;
  font-size: 16px;
  line-height: 1.95;
  color: var(--ink);
}
.svc-modal-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.svc-btn {
  display: inline-block;
  min-width: 150px;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .06em;
  text-align: center;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.svc-btn--primary {
  background: var(--accent);
  color: var(--bg);
  border: 2px solid var(--accent);
}
.svc-btn--primary:hover { background: #6aa3cb; border-color: #6aa3cb; }
.svc-btn--ghost {
  background: var(--white);
  color: var(--ink);
  border: 2px solid var(--hairline);
}
.svc-btn--ghost:hover { border-color: var(--ink-sub); }
.svc-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* 手機:同一套彈窗直接全屏 */
@media (max-width: 600px) {
  .svc-modal { padding: 0; }
  .svc-modal-dialog {
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
    padding: 28px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .svc-modal-title { font-size: 21px; }
  .svc-btn { flex: 1; min-width: 0; }
}

/* 開彈窗時鎖背景捲動(JS 補 top 偏移,iOS 也鎖得住) */
body.is-modal-open {
  position: fixed;
  left: 0; right: 0;
  overflow: hidden;
}

.float-call {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(0,0,0,.3);
  color: #fff;
  font-size: 20px;
}

/* ==========================================================================
   共用 Footer(三頁一致,深底 sitemap 式)
   ========================================================================== */
.site-footer {
  background: var(--bg);
  color: var(--text);
  padding: 72px 0 0;
  position: relative;
}
.site-footer::before {
  content: "";
  display: block;
  height: 3px;
  background: var(--grad);
  background-size: 220% 100%;
  animation: goldflow 7s ease-in-out infinite;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.1fr;
  gap: 48px;
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--line);
}
.footer-brand {
  display: block;           /* v5m:logo+公司名一列,ISO 標語在下 */
}
/* v5m:footer 回到去背 logo+文字公司名,下方以文字補 ISO 標語 */
.footer-brand-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.footer-brand-row img {
  height: 52px;
  width: auto;
  flex-shrink: 0;
}
.footer-brand .fname {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .04em;
}
.footer-brand .fname-en {
  font-size: 12px;
  color: var(--sub);
  letter-spacing: .1em;
  margin-top: 6px;
  line-height: 1.6;
}
.footer-iso {
  margin-top: 18px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.8;
  letter-spacing: .06em;
  color: var(--text);
}
.footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--accent);
  margin-bottom: 18px;
}
.footer-col ul { display: grid; gap: 12px; }
.footer-col a {
  font-size: 14.5px;
  color: var(--sub);
  letter-spacing: .02em;
  transition: color .2s ease;
}
.footer-col a:hover { color: var(--text); }
.footer-contact p {
  font-size: 14.5px;
  color: var(--sub);
  line-height: 1.9;
}
.footer-contact a.tel-mini {
  display: block;
  font-size: 19px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .02em;
  margin-bottom: 4px;
}
.footer-contact a.tel-mini:hover { color: #cfe7f5; }
/* v5p:footer 聯絡方式補 email */
.footer-contact a.footer-mail {
  display: block;
  margin: 2px 0 8px;
  font-size: 15px;
  color: var(--text);
  letter-spacing: .02em;
  word-break: break-all;
}
.footer-contact a.footer-mail:hover { color: var(--accent); }

.footer-line {
  padding: 26px 0 32px;
  text-align: center;
  font-size: 12.5px;
  color: var(--sub);
  letter-spacing: .03em;
  line-height: 1.9;
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; padding: 44px 0 32px; }
}

/* ==========================================================================
   about.html — 細長 banner
   ========================================================================== */
.page-banner {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #0b0e12;
}
.page-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.42) saturate(.9);
}
.page-banner-caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.page-banner-caption h1 {
  font-size: clamp(26px, 3.6vw, 38px);
  font-weight: 900;
  letter-spacing: .08em;
  color: #fff;
}
.page-banner-caption span {
  display: block;
  margin-top: 10px;
  font-size: clamp(11px, 1.4vw, 13px);
  font-weight: 500;
  letter-spacing: .3em;
  color: rgba(255,255,255,.75);
}

@media (max-width: 600px) {
  .page-banner { height: 140px; }
}

/* ---------- 公司簡介(圖文) ---------- */
.intro {
  background: var(--white);
  padding: 0 0 76px;
}

/* v5m:關於頁頁籤列(TNP 式:橫幅下一排,目前籤鈦藍底線+藍字,其他灰字) */
.about-tabs-bar {
  border-bottom: 1px solid var(--hairline);
  background: var(--white);
}
.about-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.about-tab {
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  padding: 20px 30px 17px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ink-sub);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.about-tab:hover { color: var(--ink); }
.about-tab.is-active {
  color: var(--blue);
  border-bottom-color: var(--accent);
}
.about-tab:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
.about-panels { padding-top: 56px; }
.about-panel.intro-more { margin-top: 0; }
/* v5:電腦版(≥601)圖左字右;v5m:圖欄跟著圖寬走,圖文間距收緊 */
.intro-split {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 40px;
  align-items: start;       /* v5h:文字對齊圖片頂端 */
}
.intro-text h2 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 900;
  letter-spacing: .04em;
  color: var(--ink);
  margin-bottom: 22px;
}
.intro-text p {
  font-size: 15.5px;
  line-height: 2;
  color: var(--ink-sub);
}
.intro-text p + p { margin-top: 14px; }

/* v5l:關於頁「本公司專營業務如下」編號清單 + 聯繫句(接在圖文下方) */
.intro-more { margin-top: 56px; }
.biz-head {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink);
  padding-bottom: 14px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.biz-list {
  margin-top: 22px;
  display: grid;
  gap: 12px;
}
.biz-list li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 18px;
  background: var(--off-white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}
.biz-no {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.biz-text {
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--ink);
  padding-top: 1px;
}
.intro-contact {
  margin-top: 32px;
  padding: 18px 22px;
  border-left: 4px solid var(--accent);
  background: var(--off-white);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--ink);
}
.intro-contact a {
  color: var(--blue);
  font-weight: 700;
  word-break: break-all;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.intro-contact a:hover { color: var(--blue-deep); }
/* v5n:聯絡頁地址下方服務句(沿用關於頁結尾句的淺底框) */
.contact-note { margin-top: 8px; }
/* v5h:about.jpg 轉正後為直式,整張等比縮小限高(不裁切),外框跟著圖縮 */
.intro-media {
  justify-self: start;
  max-width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--hairline);
}
.intro-media img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 420px;
}
/* v5p:專營業務籤——字為主、圖為插圖:清單保有好讀行寬(至少 34em),
   樣品牆照貼在右側空檔、對齊清單頂端、限高約等於清單;空間不夠先縮圖,再不夠就移到清單下方 */
.biz-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 24px 40px;
  margin-top: 22px;
}
.biz-row .biz-list {
  margin-top: 0;
  flex: 1 0 min(34em, 100%);
}
.biz-figure {
  flex: 0 1 auto;
  min-width: 240px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--hairline);
  line-height: 0;
}
.biz-figure img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 340px;
}

/* 601-900:關於頁圖片限高再收,保住右側文字欄寬 */
@media (min-width: 601px) and (max-width: 900px) {
  .intro-media img { max-height: 340px; }
  .intro-split { gap: 32px; }
}

@media (max-width: 600px) {
  .intro { padding: 56px 0; }
  .intro-split { grid-template-columns: 1fr; gap: 30px; }
  .biz-figure { min-width: 0; }
  .intro-more { margin-top: 40px; }
  .about-panels { padding-top: 36px; }
  .about-tab { padding: 16px 22px 13px; font-size: 16px; }
  .biz-list li { padding: 12px 14px; gap: 12px; }
  .intro-media { justify-self: center; }
}

/* ---------- 訂製流程 ---------- */
.process {
  background: var(--off-white);
  padding: 76px 0 84px;
}
.process-track {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 56px;
  position: relative;
}
.process-track::before {
  content: "";
  position: absolute;
  top: 19px;
  left: 4%;
  right: 4%;
  height: 2px;
  background: var(--hairline);
  z-index: 0;
}
.process-step {
  position: relative;
  z-index: 1;
  flex: 1;
  text-align: center;
  padding: 0 8px;
}
.process-step .dot {
  width: 40px;
  height: 40px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
}
.process-step h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .02em;
  line-height: 1.7;
}

/* v5f:process.html 主體——頁首已有 banner,時間軸直接開場,底部洽詢鈕 */
.process--page .process-track { margin-top: 8px; }
.process-lead {
  max-width: 40em;
  margin: 0 auto 52px;
  text-align: center;
  font-size: 17px;
  line-height: 1.9;
  letter-spacing: .04em;
  color: var(--ink-sub);
}
.process-cta {
  margin-top: 64px;
  text-align: center;
}
.process-cta .svc-btn { min-width: 200px; font-size: 17px; }

@media (max-width: 600px) {
  .process { padding: 56px 0 64px; }
  .process-lead { font-size: 16px; margin-bottom: 40px; }
  .process-track {
    flex-direction: column;
    gap: 34px;
    margin-top: 44px;
  }
  .process-track::before {
    top: 4%; bottom: 4%; left: 19px; right: auto;
    width: 2px; height: auto;
  }
  .process-step { text-align: left; display: flex; align-items: center; gap: 20px; padding: 0; }
  .process-step .dot { margin: 0; flex-shrink: 0; }
}

/* ==========================================================================
   contact.html — 聯絡資訊大字段(v5 版頭改用 .page-banner,與關於頁同款)
   ========================================================================== */
.contact-detail {
  background: var(--off-white);
  padding: 64px 0 76px;
}
.contact-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: stretch;
}
.contact-detail-info {
  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 44px 40px;
}
.tel-big-list {
  display: grid;
  gap: 24px;
  margin-bottom: 34px;
}
.tel-big {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 900;
  letter-spacing: .02em;
  line-height: 1.1;
  color: var(--blue);
  transition: transform .2s ease, color .2s ease;
  width: fit-content;
}
.tel-big:hover { transform: translateX(4px); color: var(--blue-deep); }
.tel-big small {
  font-size: 11px;
  letter-spacing: .25em;
  font-weight: 400;
  color: var(--ink-sub);
}
.contact-row {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
  align-items: flex-start;
}
.contact-row .ico {
  width: 20px;
  flex-shrink: 0;
  color: var(--blue);
  margin-top: 3px;
}
.contact-row a,
.contact-row span {
  font-size: 15px;
  letter-spacing: .02em;
  color: var(--ink);
}
.contact-row a:hover { color: var(--blue); }
.contact-company {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--hairline);
}
.contact-company .fname {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .04em;
}
.contact-company .fname-en {
  font-size: 11.5px;
  color: var(--ink-sub);
  letter-spacing: .12em;
  margin-top: 4px;
}
.map-wrap {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 360px;
  position: relative;
  background: var(--off-white);
}
.map-wrap iframe {
  width: 100%;
  height: 100%;
  min-height: 500px;
  border: 0;
}

@media (max-width: 1024px) {
  .contact-detail-grid { grid-template-columns: 1fr; }
  .map-wrap iframe { min-height: 360px; }
}
@media (max-width: 640px) {
  .contact-detail { padding: 40px 0 56px; }
  .contact-detail-info { padding: 30px 24px; }
}

/* 平板帶導航防擠(901-1180):完整導航,縮緊不縮進漢堡 */
@media (min-width: 901px) and (max-width: 1180px) {
  .nav-links { gap: 18px; }
  .nav-links a { font-size: 14px; letter-spacing: 0; }
  .nav-call a { padding: 10px 16px; font-size: 14px; }
  .brand-logo { height: 60px; }
}

/* footer 手機才單欄 */
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* 601-900(iPad直向帶):完整導航,極緊湊 */
@media (min-width: 601px) and (max-width: 900px) {
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 13px; letter-spacing: 0; padding: 6px 2px; }
  .nav-call { margin-left: 12px; }
  .nav-call a { padding: 9px 13px; font-size: 13px; }
  /* 隨寬度放大:601px 時 44px(導航仍排得下),約 685px 起到 60px 封頂 */
  .brand-logo { height: clamp(44px, calc((100vw - 421px) / 4.38), 60px); }
}

/* ==========================================================================
   v6 — 手機版(≤600px)獨立設計
   電腦版(>600px)已定稿凍結:本段全部收在這一個 media query 內,
   且放在檔案最末以覆蓋前面的手機規則;HTML 未改動。
   ========================================================================== */
@media (max-width: 600px) {

  /* ---- 首頁:ISO 信任帶兩行式(大字並排一行+承諾句一行) ---- */
  .trust-band { padding: 36px 0 34px; }
  .trust-stats { flex-direction: row; justify-content: center; gap: 0; }
  .trust-stat { padding: 0 clamp(14px, 5vw, 24px); }
  .trust-stat + .trust-stat {
    border-top: 0;
    border-left: 1px solid var(--line);
    padding-top: 0;
  }
  /* v6a:小標放在大字左上角(小字在上、大字在下,左對齊) */
  .trust-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  .trust-big { font-size: clamp(26px, 8.6vw, 34px); letter-spacing: .02em; }
  .trust-label { order: -1; margin: 0 0 2px; font-size: 13px; letter-spacing: .12em; line-height: 1.4; }
  .trust-rule { width: 48px; margin: 18px auto 14px; }
  .trust-promise { font-size: clamp(15px, 4.6vw, 18px); letter-spacing: .04em; }

  /* ---- 首頁:服務項目維持橫滑(v6a 撤回兩欄網格,沿用前段手機橫滑規則) ---- */
  .card:hover { transform: none; }

  /* ---- services.html:方卡兩欄(小卡尺寸只限此網格) ---- */
  .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .svc-item { min-width: 0; }
  .svc-grid .card { padding: 10px 10px 14px; border-radius: 14px; }
  .svc-grid .card-media { border-radius: 10px; }
  .svc-grid .card-body { padding: 12px 2px 0; }
  .svc-grid .card-body h3 { font-size: 15px; line-height: 1.45; letter-spacing: 0; }
  .svc-grid .card-tag { margin-top: 4px; font-size: 12.5px; line-height: 1.5; letter-spacing: 0; }

  /* ---- 關於:簡介籤——16:9 橫幅圖+文字,整組一張卡片 ---- */
  .intro-split {
    gap: 0;
    border: 1px solid var(--hairline);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(26, 35, 48, .06);
  }
  .intro-split .intro-media {
    justify-self: stretch;
    border: 0;
    border-radius: 0;
  }
  .intro-split .intro-media img {
    width: 100%;
    max-height: none;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }
  .intro-split .intro-text { padding: 22px 20px 24px; }
  .intro-text h2 { font-size: 22px; margin-bottom: 14px; }
  .intro-text p { font-size: 15px; line-height: 1.95; }

  /* ---- process.html:直排時間軸間距調順 ---- */
  .process--page { padding-top: 40px; }
  .process-lead { margin-bottom: 32px; }
  /* v6b:置中流程式——圓形編號+文字置中一組,步與步之間一顆 SVG 細箭頭(與版頭/橫滑箭頭同族筆觸:stroke 2、圓頭圓角) */
  .process-track { gap: 0; margin-top: 0; align-items: center; }
  .process-track::before { display: none; }
  .process-step {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 0;
    max-width: 22em;
  }
  .process-step .dot { margin: 0 auto; }
  .process-step h3 { font-size: 16px; line-height: 1.6; }
  .process-step:not(:last-child)::after {
    content: "";
    display: block;
    width: 26px;
    height: 26px;
    margin: 8px auto 12px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%237fb4d8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .process-cta { margin-top: 40px; }
  .process-cta .svc-btn { display: block; width: 100%; }

  /* ---- contact.html:單欄,電話做成大撥號鈕 ---- */
  .contact-detail { padding: 28px 0 48px; }
  .contact-detail-grid { gap: 20px; }
  .contact-detail-info { padding: 22px 18px 24px; }
  .tel-big-list { gap: 14px; margin-bottom: 24px; }
  a.tel-big {
    width: 100%;
    align-items: center;
    padding: 16px 18px 18px;
    border-radius: 14px;
    background: var(--blue);
    color: #ffffff;
    font-size: clamp(22px, 7.4vw, 28px);
    text-align: center;
    box-shadow: 0 8px 20px rgba(46, 109, 164, .28);
  }
  a.tel-big small { color: rgba(255, 255, 255, .85); font-size: 12px; }
  a.tel-big:hover, a.tel-big:active { transform: none; color: #ffffff; background: var(--blue-deep); }
  .tel-fax { width: 100%; align-items: center; text-align: center; font-size: 20px; }
  .contact-row a, .contact-row span { word-break: break-all; }
  .map-wrap { min-height: 300px; }
  .map-wrap iframe { min-height: 300px; }

  /* ---- footer(v6a):logo 組整寬在上,下方「網站導覽」「聯絡方式」兩欄並排 ---- */
  .footer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 28px 20px;
    padding: 40px 0 30px;
  }
  .footer-brand { grid-column: 1 / -1; }
  .footer-col h4 { margin-bottom: 14px; }
  .footer-col ul { gap: 10px; }
  .footer-contact .tel-mini { display: block; font-size: 13.5px; }
  .footer-contact a.tel-mini { font-size: 15px; color: var(--accent); }
  .footer-contact a.footer-mail { font-size: 13px; margin: 2px 0 8px; }
  .footer-contact p { font-size: 13.5px; line-height: 1.8; }

  /* ---- 彈窗:全屏,底部按鈕固定在可視範圍 ---- */
  .svc-modal-dialog { padding-bottom: 0; }
  .svc-modal-media img { max-height: 42vh; }
  .svc-modal-actions {
    position: sticky;
    bottom: 0;
    margin: 20px -20px 0;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--white);
    border-top: 1px solid var(--hairline);
    flex-wrap: nowrap;
  }
}

/* ==========================================================================
   v6d — 手機動畫(≤600px 且未開「減少動態」;開了就全靜止)
   只用 transform / opacity;電腦版吃不到本段
   ========================================================================== */
@media (max-width: 600px) and (prefers-reduced-motion: no-preference) {

  /* 1. 進場浮現:同組依序淡入+輕微上浮(--i 由 JS 設定,間隔 75ms) */
  .m-rise {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1);
    transition-delay: calc(var(--i, 0) * 75ms);
  }
  .m-rise.is-in { opacity: 1; transform: none; }

  /* 2. 按壓回饋:按下微縮 0.97,放開彈回(100ms) */
  .card { transition: transform .1s ease, box-shadow .25s ease; }
  .svc-btn { transition: transform .1s ease, background .2s ease, color .2s ease, border-color .2s ease; }
  .nav-call a, a.tel-big, .about-tab, .float-call, .section-more, .mobile-menu a {
    transition: transform .1s ease, color .2s ease, background .2s ease;
  }
  .card:active,
  .svc-btn:active,
  .nav-call a:active,
  a.tel-big:active,
  .about-tab:active,
  .float-call:active,
  .section-more:active,
  .mobile-menu a:active { transform: scale(.97); }

  /* 3. 彈窗 FLIP 登場:卡片長大成全屏時,遮罩與內容淡入;關閉時先淡出再縮回 */
  .svc-modal.m-open .svc-modal-backdrop { animation: mFadeIn .3s ease both; }
  .svc-modal.m-open .svc-modal-dialog > * { animation: mFadeIn .26s ease .16s both; }
  .svc-modal.m-close .svc-modal-backdrop { opacity: 0; transition: opacity .3s ease; }
  .svc-modal.m-close .svc-modal-dialog > * { opacity: 0; transition: opacity .12s ease; }
  @keyframes mFadeIn { from { opacity: 0; } to { opacity: 1; } }

  /* 4. 流程頁逐格點亮:步驟 1→箭頭→2…每 300ms 一格,1.5 秒內跑完五步
        觸發=時間軸本身既有的 .reveal → .is-visible */
  .process-track.reveal { opacity: 1; transition: none; }
  .process-step {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .3s ease, transform .3s ease;
  }
  .process-step::after { opacity: 0; transition: opacity .25s ease; }
  .process-track.is-visible .process-step { opacity: 1; transform: none; }
  .process-track.is-visible .process-step::after { opacity: 1; }
  .process-track.is-visible .process-step .dot { animation: mDotPop .36s cubic-bezier(.3, 1.6, .5, 1) both; }
  @keyframes mDotPop {
    0% { transform: scale(.6); }
    100% { transform: scale(1); }
  }
  .process-step:nth-child(1), .process-step:nth-child(1) .dot { transition-delay: 0ms; animation-delay: 0ms; }
  .process-step:nth-child(2), .process-step:nth-child(2) .dot { transition-delay: 300ms; animation-delay: 300ms; }
  .process-step:nth-child(3), .process-step:nth-child(3) .dot { transition-delay: 600ms; animation-delay: 600ms; }
  .process-step:nth-child(4), .process-step:nth-child(4) .dot { transition-delay: 900ms; animation-delay: 900ms; }
  .process-step:nth-child(5), .process-step:nth-child(5) .dot { transition-delay: 1200ms; animation-delay: 1200ms; }
  .process-step:nth-child(1)::after { transition-delay: 150ms; }
  .process-step:nth-child(2)::after { transition-delay: 450ms; }
  .process-step:nth-child(3)::after { transition-delay: 750ms; }
  .process-step:nth-child(4)::after { transition-delay: 1050ms; }
}
