/* =========================================================
   穎顓工業 WINTRADE — 工業風網站樣式
   色彩：深海軍藍 / 鋼灰 + 安全橘點綴
   ========================================================= */
:root {
  --navy-950: #08131b;
  --navy-900: #0d1c27;
  --navy-800: #132a39;
  --navy-700: #1b3a4d;
  --steel-600: #3f5666;
  --steel-500: #5a6e7b;
  --steel-400: #8396a2;
  --steel-200: #c9d3d9;
  --line: #dfe5e9;
  --bg: #f3f5f7;
  --white: #fff;
  --orange: #e8620f;
  --orange-600: #c9520a;
  --orange-50: #fff3eb;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", system-ui, sans-serif;
  --font-num: "Barlow Condensed", "Arial Narrow", "Noto Sans TC", sans-serif;
  /* 標題用思源宋體（業主 12-05 從五種比較中選定），內文維持思源黑體 */
  --font-head: "Noto Serif TC", var(--font);
  --radius: 4px;
  --shadow: 0 10px 30px -12px rgba(8, 19, 27, .25);
  --wrap: 1240px;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; font: 400 16px/1.75 var(--font); color: var(--navy-900); background: var(--white); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .6em; font-family: var(--font-head); line-height: 1.3; font-weight: 700; letter-spacing: .01em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); font-weight: 900; }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.35rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul { padding-left: 1.2em; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.wrap { width: min(var(--wrap), calc(100% - 48px)); margin-inline: auto; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--white); padding: 10px 16px; font-weight: 700; }
.skip:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-family: var(--font-num); font-weight: 700; letter-spacing: .01em; }
.nb { white-space: nowrap; }
[hidden] { display: none !important; }
html:not(.js) .js-only { display: none !important; }
mark.todo { background: #fff4c2; color: #6b4e00; padding: 0 .35em; border: 1px dashed #d8b200; border-radius: 3px; font-size: .9em; font-weight: 500; }

/* ---------- Preview ribbon ---------- */
.preview-ribbon { background: var(--orange); color: #fff; text-align: center; font-size: 13px; padding: 6px 12px; letter-spacing: .04em; }

/* ---------- Top bar ---------- */
.topbar { background: var(--navy-950); color: var(--steel-200); font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; min-height: 38px; }
.topbar a { text-decoration: none; }
.topbar a:hover { color: #fff; }
.topbar-items { display: flex; gap: 24px; }
.topbar-items span, .topbar-items a { display: inline-flex; align-items: center; gap: 6px; }
.topbar svg { width: 14px; height: 14px; fill: var(--orange); flex: none; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.97); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); transition: box-shadow .2s; }
.site-header.scrolled { box-shadow: 0 6px 20px -10px rgba(8,19,27,.25); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: var(--header-h); }
/* 商標：圖形獨立一塊；右邊上行是公司全名的字樣（SVG），下行是英文名稱。
   --bn 是字樣的高度，英文的字級跟著它走，配上 .123em 的字距，上下兩行一樣寬；
   負的右邊界是把最後一個字後面多出來的字距收掉。換尺寸只要改 --bn */
.brand { --bn: 20.7px; display: inline-flex; align-items: center; gap: 14px; min-height: 44px; text-decoration: none; }
.brand-logo { height: 40px; width: auto; flex: none; fill: currentColor; color: var(--navy-900); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { display: block; height: var(--bn); width: auto; fill: currentColor; color: var(--navy-900); }
/* 英文名稱用 Cinzel（羅馬碑文體，開放授權）：小寫字母會顯示成小型大寫，WinTrade 的 W 和 T 保持大寫。
   字級 = 中文字樣高度 × .64，字距 .04em，兩行剛好一樣寬。中文字樣換了（NAME_BOX 的寬高比變了）要重算：
   字級係數 = (NAME_W / NAME_H) ÷ 17.23 */
.brand-text small { font-family: "Cinzel", "Times New Roman", serif; font-weight: 700; font-size: calc(var(--bn) * .64); letter-spacing: .04em; margin: 4px -.04em 0 0; color: var(--steel-600); white-space: nowrap; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav > a, .nav-item > a { text-decoration: none; font-weight: 500; font-size: .96rem; padding: 10px 14px; border-radius: var(--radius); position: relative; }
.main-nav a:hover { color: var(--orange); }
.main-nav a[aria-current="page"] { color: var(--orange); }
.main-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; background: var(--orange); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-phone { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--font-num); font-weight: 700; font-size: 1.2rem; letter-spacing: .02em; }
.header-phone svg { width: 18px; height: 18px; fill: var(--orange); }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: var(--radius); width: 46px; height: 46px; padding: 0; cursor: pointer; }
.menu-toggle span { display: block; width: 20px; height: 2px; background: var(--navy-900); margin: 4px auto; transition: transform .2s, opacity .2s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* 下拉選單：滑鼠移上去，或按名稱旁的小箭頭打開。手機版（≤960px）是選單裡可以展開的清單，見下方 Responsive。 */
.nav-item { position: relative; display: flex; align-items: center; }
.sub-toggle { position: relative; z-index: 1; display: inline-grid; place-items: center; width: 22px; height: 40px; margin-left: -12px; padding: 0; background: none; border: 0; border-radius: var(--radius); color: var(--steel-500); cursor: pointer; }
.sub-toggle svg { width: 10px; height: 7px; transition: transform .2s; }
.nav-item:hover > .sub-toggle, .sub-toggle[aria-expanded="true"] { color: var(--orange); }
.sub-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.sub-menu { position: absolute; top: calc(100% + 10px); left: 4px; z-index: 60; min-width: 200px; padding: 12px 0; background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--orange); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s, transform .15s, visibility 0s .15s; }
.sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; } /* 滑鼠從名稱移到選單時不會中斷 */
.nav-item:hover > .sub-menu, .nav-item.open > .sub-menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.nav-item.hold:hover > .sub-menu { opacity: 0; visibility: hidden; } /* 點了子項以後先收起，滑鼠離開再恢復 */
.sub-menu ul { list-style: none; margin: 0; padding: 0; }
.sub-menu a { display: block; padding: 8px 22px; font-size: .93rem; font-weight: 500; color: var(--navy-900); text-decoration: none; white-space: nowrap; }
.sub-menu a:hover, .sub-menu a:focus-visible { color: var(--orange); background: var(--bg); }
.sub-wide { display: grid; grid-template-columns: repeat(var(--cols, 3), max-content); column-gap: 4px; left: -40px; padding: 18px 6px 10px; } /* --cols：類別數 */
.sub-wide a { padding: 8px 16px; }
.sub-title { margin: 0 0 4px; padding: 0 22px; font-size: .8rem; font-weight: 700; letter-spacing: .06em; color: var(--steel-500); }
.sub-wide .sub-title { padding: 0 16px; }
.sub-wide .sub-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.sub-wide .sub-links a { color: var(--orange); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 12px 26px; border-radius: var(--radius); border: 2px solid transparent; font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .15s; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-600); }
.btn-outline { border-color: currentColor; color: var(--navy-900); background: transparent; }
.btn-outline:hover { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.btn-ghost-light { border-color: rgba(255,255,255,.55); color: #fff; background: rgba(255,255,255,.04); }
.btn-ghost-light:hover { background: #fff; color: var(--navy-900); border-color: #fff; }
.btn-sm { min-height: 42px; padding: 8px 18px; font-size: .95rem; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--orange); text-decoration: none; }
.link-arrow::after { content: "→"; transition: transform .15s; }
.link-arrow:hover::after { transform: translateX(4px); }

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; background: var(--navy-900); overflow: hidden; isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 70% center; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8,19,27,.94) 0%, rgba(8,19,27,.82) 38%, rgba(8,19,27,.35) 70%, rgba(8,19,27,.2) 100%), linear-gradient(0deg, rgba(8,19,27,.7) 0%, transparent 35%); }
.hero-inner { padding: clamp(72px, 10vw, 140px) 0 clamp(150px, 15vw, 190px); max-width: 720px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: .85rem; font-weight: 700; letter-spacing: .16em; color: var(--orange); margin-bottom: 18px; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.hero h1 { margin-bottom: 22px; }
.hero h1 .hl { color: var(--orange); }
.hero h1 .num { font-size: 1.22em; line-height: 1; letter-spacing: 0; } /* 主標題裡的「12」用規格列同一種數字字體，大一點 */
.hero .lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: #d6e0e6; max-width: 600px; margin-bottom: 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-caption { position: absolute; right: 24px; bottom: 132px; font-size: 11px; color: rgba(255,255,255,.55); letter-spacing: .06em; }

.spec-bar { position: relative; z-index: 2; margin-top: -96px; }
.spec-grid { display: grid; grid-template-columns: 1.15fr repeat(3, 1fr); background: var(--white); box-shadow: var(--shadow); border-top: 4px solid var(--orange); }
.spec-grid .spec-title { background: var(--navy-800); color: #fff; padding: 26px 28px; display: flex; flex-direction: column; justify-content: center; }
.spec-grid .spec-title strong { font-size: 1.1rem; }
.spec-grid .spec-title span { font-size: .82rem; color: var(--steel-200); }
.spec-item { padding: 22px 28px; border-left: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.spec-item .label { font-size: .82rem; color: var(--steel-500); font-weight: 500; margin-bottom: 4px; }
.spec-item .value { font-family: var(--font-num); font-weight: 700; font-size: 2.75rem; line-height: 1.05; color: var(--navy-900); }
.spec-item .value small { font-size: 1.15rem; margin-left: 5px; color: var(--steel-500); font-weight: 600; }
.spec-note { font-size: .82rem; color: var(--steel-500); margin: 12px 0 0; }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 8vw, 110px) 0; }
.section-alt { background: var(--bg); }
.section-tight { padding: clamp(40px, 5vw, 64px) 0; }
.section-dark { background: var(--navy-900); color: #fff; }
.section-dark p { color: var(--steel-200); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 44px; }
.section-head > div { max-width: 720px; }
.section-head p { color: var(--steel-500); font-size: 1.05rem; margin: 0; }
.section-head > .btn { flex: none; }
.section-dark .section-head p { color: var(--steel-200); }
.section-head h2 { margin-bottom: 12px; }

/* ---------- Featured services ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 24px; } /* --cols：卡片數，由 build.py 設定 */
.feature-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature-card .media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--navy-800); position: relative; }
.feature-grid.is-two .feature-card .media { aspect-ratio: 16 / 9; } /* 只有兩張卡時卡片較寬，圖改扁一點，整段高度和三張時差不多 */
.feature-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.feature-card:hover .media img { transform: scale(1.04); }
.feature-card .tag { position: absolute; left: 16px; top: 16px; background: var(--orange); color: #fff; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 2px; letter-spacing: .06em; }
.feature-card .body { padding: 26px 26px 28px; display: flex; flex-direction: column; flex: 1; }
.feature-card h3 { font-size: 1.3rem; }
.feature-card p { color: var(--steel-500); }
.feature-card ul { margin: 0 0 22px; padding: 0; list-style: none; }
.feature-card li { padding: 6px 0 6px 22px; position: relative; border-top: 1px dashed var(--line); font-size: .95rem; }
.feature-card li::before { content: ""; position: absolute; left: 2px; top: 15px; width: 10px; height: 2px; background: var(--orange); }
.feature-card .link-arrow { margin-top: auto; }

/* ---------- Service catalog ---------- */
.catalog-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.catalog-filters button { border: 1px solid var(--steel-200); background: var(--white); padding: 8px 18px; border-radius: 999px; font-weight: 500; cursor: pointer; font-size: .95rem; }
.catalog-filters button:hover { border-color: var(--navy-900); }
.catalog-filters button[aria-pressed="true"] { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.catalog-card { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 24px; align-items: center; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--navy-700); padding: 22px 24px; border-radius: var(--radius); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.catalog-card:hover { border-left-color: var(--orange); box-shadow: var(--shadow); }
.catalog-card[hidden] { display: none; }
.cat-g { display: flex; flex-direction: column; gap: 10px; }
.cat-eq { font-size: .78rem; font-weight: 700; color: var(--steel-600); text-align: center; line-height: 1.4; }
.cat-b { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.catalog-card .meta { font-size: .8rem; font-weight: 700; color: var(--orange); letter-spacing: .08em; }
.catalog-card h3 { margin: 0; font-size: 1.12rem; }
.catalog-card p { margin: 0; color: var(--steel-500); font-size: .94rem; }
.catalog-card .go { margin-top: 8px; font-size: .9rem; font-weight: 700; color: var(--navy-700); }
.catalog-card:hover .go { color: var(--orange); }

/* ---------- Why us ---------- */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.12); }
.why-item { background: var(--navy-900); padding: 34px 28px; }
.why-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; margin-bottom: 20px; }
.why-item .icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(232,98,15,.14); flex: none; }
.why-item .icon svg { width: 26px; height: 26px; stroke: var(--orange); fill: none; stroke-width: 1.8; }
.why-item h3 { color: #fff; font-size: 1.15rem; }
.why-item p { margin: 0; font-size: .95rem; }
.why-item .big { font-family: var(--font-num); font-size: 2.6rem; font-weight: 700; color: var(--orange); line-height: 1; white-space: nowrap; }

/* ---------- Split ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.split > *, .detail-grid > *, .contact-grid > *, .fit > *, .eq-pick > * { min-width: 0; }
.split-media { position: relative; }
.split-frame { position: relative; }
.split-media img { width: 100%; border-radius: var(--radius); aspect-ratio: 4 / 3; object-fit: cover; }
.split-media .badge { position: absolute; left: -16px; bottom: -16px; background: var(--orange); color: #fff; padding: 16px 22px; border-radius: var(--radius); box-shadow: var(--shadow); }
.split-media .badge strong { font-family: var(--font-num); font-size: 2.2rem; display: block; line-height: 1; }
.split-media .badge span { font-size: .85rem; }
.img-note { font-size: 11px; color: var(--steel-400); margin: 8px 0 0; text-align: right; }
.split-fill { align-items: stretch; }
.split-fill .split-media { display: flex; flex-direction: column; }
.split-fill .split-frame { flex: 1; min-height: 360px; }
.split-fill .split-frame img { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }

/* ---------- Equipment table ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); max-width: 100%; }
.eq-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.eq-table th, .eq-table td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.eq-table.compact { min-width: 540px; }
.eq-table.compact th, .eq-table.compact td { padding: 12px 14px; }
.eq-table thead th { background: var(--navy-800); color: #fff; font-size: .88rem; font-weight: 500; letter-spacing: .04em; white-space: nowrap; }
.eq-table tbody td:first-child { white-space: nowrap; }
.eq-table tbody tr:last-child td { border-bottom: 0; }
.eq-table tbody tr:hover { background: var(--orange-50); }
.eq-table .num { font-size: 1.22rem; }
.eq-table .hl-row { background: #fff8f2; }
.eq-table .type { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 2px; background: var(--bg); color: var(--steel-600); white-space: nowrap; }
.eq-table .type.big { background: var(--orange); color: #fff; }
/* 分組列：龍門銑床、CNC 龍門加工中心（後面跟一句說明） */
.eq-table .eq-group th { padding: 12px 18px; background: var(--bg); color: var(--navy-900); font-size: .95rem; font-weight: 700; letter-spacing: .02em; white-space: normal; }
.eq-table tbody + tbody .eq-group th { border-top: 1px solid var(--line); }
.eq-table .eq-group th span { margin-left: 12px; font-size: .82rem; font-weight: 400; letter-spacing: 0; color: var(--steel-500); }
.eq-table tbody tr.eq-group:hover { background: none; }
.eq-sub { display: block; margin-top: 2px; font-size: .78rem; color: var(--steel-500); white-space: normal; }
.eq-z { display: block; font-size: .75rem; color: var(--steel-500); }
.eq-table td.eq-na { color: var(--steel-400); }
.eq-st { display: block; margin-top: 2px; font-size: .82rem; font-weight: 700; color: var(--steel-500); white-space: normal; }
.eq-table tr.is-fit .eq-st { color: var(--orange-600); }
.eq-table tr.is-fit { background: #fff8f2; }
.eq-table tr.is-no .num { color: var(--steel-400); }
.table-note { font-size: .85rem; color: var(--steel-500); margin-top: 14px; }

/* ---------- Workpieces ---------- */
.wp-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.wp-item { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 20px; text-align: center; }
.wp-item { transition: border-color .15s, box-shadow .15s, transform .2s; }
.wp-item:hover { border-color: var(--steel-200); box-shadow: var(--shadow); transform: translateY(-3px); }
.glyph { display: block; width: 96px; height: 62px; margin: 0 auto 16px; stroke: var(--navy-800); stroke-width: 1.3; stroke-linejoin: round; }
.glyph .gt { fill: #fff; }
.glyph .gl { fill: #e9eef1; }
.glyph .gr { fill: #d5dde2; }
.glyph .gh { fill: var(--orange); stroke: var(--navy-800); }
.wp-item h4 { font-size: 1.02rem; margin-bottom: 6px; }
.wp-item p { font-size: .88rem; color: var(--steel-500); margin: 0; }
/* 首頁：常加工的工件放在加工服務區塊裡、服務卡下面 */
.wp-block { margin-top: 64px; }
.wp-head { font-size: 1.35rem; margin-bottom: 6px; }
.wp-sub { color: var(--steel-500); margin: 0 0 22px; }

/* ---------- Process ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.step { position: relative; padding: 30px 24px 26px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.step::before { counter-increment: step; content: "0" counter(step); font-family: var(--font-num); font-weight: 700; font-size: 3rem; line-height: 1; color: var(--orange); display: block; margin-bottom: 14px; }
.step:not(:last-child)::after { content: ""; position: absolute; top: 52px; right: -24px; width: 24px; height: 2px; background: var(--steel-200); }
.step h3 { font-size: 1.12rem; margin-bottom: 8px; }
.step p { color: var(--steel-500); font-size: .94rem; margin: 0; }
/* 首頁的精簡版：只有編號和標題排成一列，完整說明在「關於穎顓」頁 */
.steps-compact .step { display: flex; align-items: center; gap: 14px; padding: 20px 22px; }
.steps-compact .step::before { font-size: 2.1rem; margin: 0; }
.steps-compact .step h3 { margin: 0; font-size: 1.08rem; }
.steps-compact .step:not(:last-child)::after { top: 50%; }
.steps-links { display: flex; flex-wrap: wrap; gap: 6px 32px; margin-top: 24px; }
/* 加工服務頁「依圖整件代工」：在服務列表下面，五個步驟一排，每一步右上角標明是協力廠還是本廠 */
.turnkey { margin-top: 72px; padding-top: 56px; border-top: 1px solid var(--line); }
.steps-5 { grid-template-columns: repeat(5, 1fr); }
.step .by { position: absolute; top: 32px; right: 18px; padding: 1px 10px; border: 1px solid var(--steel-200); border-radius: 999px; background: var(--white); color: var(--steel-600); font-size: .78rem; font-weight: 700; line-height: 1.6; }
.step .by-own { border-color: var(--navy-900); background: var(--navy-900); color: #fff; }
.turnkey-note { max-width: 880px; margin: 24px 0 0; color: var(--steel-600); }
/* 首頁服務卡下面那一句，連到上面那段 */
.turnkey-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; margin: 28px 0 0; padding: 16px 22px; border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: var(--radius); background: var(--bg); color: var(--steel-600); }
.turnkey-line .link-arrow { flex: none; }

/* ---------- Cases placeholder ---------- */
.case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.case-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.case-card .media { aspect-ratio: 4 / 3; background: repeating-linear-gradient(45deg, #eef1f3 0 12px, #e6eaed 12px 24px); display: grid; place-items: center; color: var(--steel-400); font-weight: 700; position: relative; overflow: hidden; }
.case-card .media img { width: 100%; height: 100%; object-fit: cover; }
.case-card .body { padding: 20px 22px; }
.case-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: .9rem; }
.case-card dt { color: var(--steel-500); }
.case-card dd { margin: 0; font-weight: 500; }

/* ---------- FAQ ---------- */
.faq { max-width: 900px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 48px 22px 0; font-weight: 700; font-size: 1.08rem; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 1.6rem; font-weight: 400; color: var(--orange); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { color: var(--steel-600); padding: 0 48px 22px 0; margin: 0; }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(120deg, var(--navy-800), var(--navy-950)); color: #fff; position: relative; overflow: hidden; }
.cta-band::after { content: ""; position: absolute; right: -80px; top: -80px; width: 360px; height: 360px; border: 60px solid rgba(232,98,15,.12); border-radius: 50%; }
.cta-band .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; padding-block: clamp(56px, 7vw, 88px); position: relative; z-index: 1; }
.cta-band h2 { margin-bottom: 10px; }
.cta-band p { color: var(--steel-200); margin: 0; }
.cta-contact { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.cta-phone { font-family: var(--font-num); font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; text-decoration: none; line-height: 1; display: inline-flex; align-items: center; gap: 12px; }
.cta-phone svg { width: 30px; height: 30px; fill: var(--orange); }
.cta-contact small { color: var(--steel-200); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { background: var(--navy-900); color: #fff; position: relative; overflow: hidden; isolation: isolate; }
.page-hero .bg { position: absolute; inset: 0; z-index: -2; opacity: .35; }
.page-hero .bg img { width: 100%; height: 100%; object-fit: cover; }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8,19,27,.95) 20%, rgba(8,19,27,.6)); }
.page-hero .wrap { padding: clamp(48px, 7vw, 88px) 0; }
.page-hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 14px; }
.page-hero p { color: var(--steel-200); font-size: 1.08rem; max-width: 720px; margin: 0; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 22px; font-size: .88rem; color: var(--steel-200); }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--steel-400); }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--orange); }

/* ---------- Service detail ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 56px; align-items: start; }
.detail-main h2 { font-size: 1.55rem; margin-top: 8px; }
.detail-main h2:not(:first-child) { margin-top: 48px; }
.detail-main > p { color: var(--steel-600); font-size: 1.04rem; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-list li { position: relative; padding: 14px 16px 14px 46px; background: var(--bg); border-radius: var(--radius); font-weight: 500; }
.check-list li::before { content: ""; position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: var(--orange) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z' fill='%23fff'/%3E%3C/svg%3E") center / 14px no-repeat; }
.prep-list { counter-reset: prep; list-style: none; padding: 0; margin: 0; }
.prep-list li { counter-increment: prep; display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.prep-list li::before { content: counter(prep, decimal-leading-zero); font-family: var(--font-num); font-weight: 700; color: var(--orange); font-size: 1.2rem; min-width: 28px; }
.detail-photo { margin: 28px 0 0; }
.detail-photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); }
.eq-pick { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.eq-pick .fig { margin: 0; }
.mini-eq { display: grid; grid-template-columns: 1fr; gap: 12px; }
.mini-eq div { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.mini-eq strong { display: block; font-size: .95rem; }
.mini-eq span { font-family: var(--font-num); font-size: 1.15rem; font-weight: 700; color: var(--navy-700); }
.sidebar { position: sticky; top: calc(var(--header-h) + 24px); display: flex; flex-direction: column; gap: 20px; }
.side-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; background: var(--white); }
.side-card.dark { background: var(--navy-900); color: #fff; border-color: var(--navy-900); }
.side-card.dark p { color: var(--steel-200); font-size: .95rem; }
.side-card h3 { font-size: 1.1rem; }
.side-card .btn { width: 100%; margin-top: 8px; }
.side-card .cta-phone { font-size: 1.9rem; margin: 6px 0 4px; }
.side-card ul { list-style: none; padding: 0; margin: 0; }
.side-card li a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 500; }
.side-card li:last-child a { border-bottom: 0; }
.side-card li a:hover { color: var(--orange); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 380px 1fr; gap: 48px; align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 0 0 24px; }
.contact-list li { display: flex; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.contact-list .ic { width: 44px; height: 44px; border-radius: 50%; background: var(--orange-50); display: grid; place-items: center; flex: none; }
.contact-list .ic svg { width: 20px; height: 20px; fill: var(--orange); }
.contact-list small { display: block; color: var(--steel-500); font-size: .82rem; }
.contact-list a, .contact-list strong { font-weight: 700; font-size: 1.08rem; text-decoration: none; word-break: break-all; }
.contact-list .hours-table { display: grid; grid-template-columns: auto auto; justify-content: start; column-gap: 1em; row-gap: 2px; word-break: normal; } /* 營業時間：星期一欄、時間一欄 */
.contact-list a:hover { color: var(--orange); }
.map-frame { border: 0; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius); background: var(--bg); }
.form-card { background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--orange); border-radius: var(--radius); padding: clamp(24px, 4vw, 44px); box-shadow: var(--shadow); }
.form-card h2 { font-size: 1.6rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 700; font-size: .94rem; margin-bottom: 6px; }
.field label .req, legend .req { color: var(--orange); margin-left: 8px; font-size: .78rem; font-weight: 700; }
.field label .opt, legend .opt { color: var(--steel-400); font-weight: 400; font-size: .82rem; margin-left: 6px; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--steel-200); border-radius: var(--radius); background: #fbfcfd; padding: 12px 14px; min-height: 48px; transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,98,15,.18); background: #fff; }
.field [aria-invalid="true"] { border-color: #c62828; }
.field .err { color: #c62828; font-size: .85rem; margin: 6px 0 0; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 26px; }
.form-lead { color: var(--steel-500); }
.form-note { padding: 14px 16px; border-radius: var(--radius); background: var(--bg); }
.form-from { margin: 14px 0 0; font-size: .9rem; font-weight: 500; color: var(--orange-600); }
.form-status { margin-top: 22px; padding: 22px 24px; border-radius: var(--radius); border: 1px solid var(--line); border-left: 4px solid var(--orange); background: var(--bg); }
.form-status:focus { outline: none; }
.form-status h3 { margin-bottom: 8px; }
.form-status p { margin: 0 0 8px; }
.sent-act { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.sent-pre { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 6px; }
.form-status textarea { width: 100%; border: 1px solid var(--steel-200); border-radius: var(--radius); background: #fff; padding: 12px 14px; font-size: .92rem; line-height: 1.7; resize: vertical; }
.sent-fine { font-size: .85rem; color: var(--steel-500); margin: 10px 0 0 !important; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--steel-200); padding: 6px 14px; border-radius: 999px; cursor: pointer; font-weight: 500; font-size: .92rem; margin: 0; }
.chips input { width: auto; min-height: 0; accent-color: var(--orange); }
.chips label:has(input:checked) { border-color: var(--orange); background: var(--orange-50); }
/* 「材料與前後製程」：只能選一個、字比較長，用方角的選項，寬度夠就兩個並排 */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.choices label { display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--steel-200); border-radius: var(--radius); padding: 10px 14px; cursor: pointer; font-weight: 500; font-size: .92rem; line-height: 1.55; margin: 0; }
.choices input { width: auto; min-height: 0; margin: .3em 0 0; flex: none; accent-color: var(--orange); }
.choices label:has(input:checked) { border-color: var(--orange); background: var(--orange-50); }
.choices small { display: block; color: var(--steel-500); font-size: .84rem; font-weight: 400; }

/* ---------- About ---------- */
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.values .value { padding: 28px; border-top: 3px solid var(--orange); background: var(--bg); }
.values .value h3 { font-size: 1.15rem; }
.values .value p { color: var(--steel-600); margin: 0; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.facts div { padding: 24px; border-left: 1px solid var(--line); }
.facts div:first-child { border-left: 0; }
.facts dt { font-size: .85rem; color: var(--steel-500); }
.facts dd { margin: 4px 0 0; font-weight: 700; font-size: 1.05rem; }
.facts-lg { border-top: 4px solid var(--orange); box-shadow: var(--shadow); }
.facts-lg div { padding: 26px 28px; }
.facts-lg dd { font-size: 1rem; font-weight: 500; color: var(--steel-600); }
.facts-lg .num { font-size: 2.6rem; line-height: 1.1; color: var(--navy-900); margin-right: 4px; }
.facts-lg small { display: block; font-size: .82rem; font-weight: 400; color: var(--steel-500); }
/* 加工服務頁「怎麼選」：龍門銑床與 CNC 龍門加工中心對照 */
.vs-table { width: 100%; margin-top: 24px; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--orange); border-radius: var(--radius); box-shadow: var(--shadow); }
.vs-table th, .vs-table td { padding: 14px 16px; text-align: left; vertical-align: top; line-height: 1.65; border-bottom: 1px solid var(--line); }
.vs-table thead th { font-family: var(--font-head); font-size: 1.05rem; color: var(--navy-900); }
.vs-table th { word-break: keep-all; }  /* 標題只在空格或 <wbr> 斷行，不會剩一個字掉到下一行 */
.vs-table tbody th { width: 6.5em; font-size: .85rem; font-weight: 500; color: var(--steel-500); white-space: nowrap; }
.vs-table td + td, .vs-table th + th { border-left: 1px solid var(--line); }
.vs-table tbody tr:last-child > * { border-bottom: 0; }
.vs-note { margin-top: 16px; color: var(--steel-600); }
.vs-note strong { color: var(--navy-900); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-950); color: var(--steel-200); font-size: .94rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; padding: 64px 0 48px; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 16px; letter-spacing: .06em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--orange); }
.site-footer .brand-logo, .site-footer .brand-name { color: #fff; }
.site-footer .brand-text small { color: var(--steel-400); }
.footer-about { margin-top: 18px; max-width: 340px; }
.footer-phone { font-family: var(--font-num); font-size: 1.7rem; font-weight: 700; color: #fff; display: inline-block; margin-bottom: 4px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0; font-size: .82rem; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--steel-400); }

/* ---------- Mobile action bar ---------- */
.mobile-bar { display: none; }

/* ---------- Reveal animation ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
  html.js .reveal.in { opacity: 1; transform: none; }
}
@media print {
  html.js .reveal { opacity: 1 !important; transform: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- 尺寸比對（深色藍圖區塊） ---------- */
.blueprint { position: relative; isolation: isolate; overflow: hidden; background: var(--navy-900); }
.blueprint::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(120% 90% at 78% 50%, #000 30%, transparent 100%); -webkit-mask-image: radial-gradient(120% 90% at 78% 50%, #000 30%, transparent 100%); }
.fit { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.fit-full .fit { align-items: start; }
.fit-copy > p { color: var(--steel-200); }
.fit-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 26px; }
.fit-f { display: block; padding: 10px 14px 8px; border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius); background: rgba(255,255,255,.05); cursor: text; transition: border-color .15s, box-shadow .15s, background .15s; }
.fit-f:focus-within { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,98,15,.28); background: rgba(255,255,255,.08); }
.fit-f span { display: block; font-size: .8rem; font-weight: 500; color: var(--steel-200); line-height: 1.3; }
.fit-f input { display: block; width: 100%; padding: 0; border: 0; outline: 0; background: none; color: #fff; font: 700 1.75rem/1.25 var(--font-num); letter-spacing: .02em; }
.fit-f input::placeholder { color: rgba(255,255,255,.28); }
.fit-pre { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; font-size: .82rem; color: var(--steel-400); }
.fit-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 11px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: none; color: var(--steel-200); font-size: .85rem; cursor: pointer; white-space: nowrap; transition: border-color .15s, color .15s, background .15s; }
.fit-chip:hover { border-color: var(--orange); color: #fff; background: rgba(232,98,15,.12); }
.fit-chip .num { font-size: .98rem; color: #fff; letter-spacing: .01em; }
.fit .fit-res { margin: 26px 0 0; padding: 16px 18px; border-left: 4px solid var(--steel-600); background: rgba(255,255,255,.05); color: #fff; font-size: 1.1rem; font-weight: 700; line-height: 1.6; transition: border-color .2s; }
.fit .fit-res.is-fit { border-left-color: var(--orange); }
.fit .fit-note { margin: 12px 0 0; font-size: .82rem; line-height: 1.7; color: var(--steel-400); }
.fit-go { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.fit-draw { display: grid; gap: 28px; }

/* ---------- 比例圖 ----------
   .dg 是一張圖；--world 是畫面橫向代表的 mm 數，--ratio 是畫面高寬比。
   每個框用 --w／--h（mm）定大小，全部貼齊左下角的基準點。預設是深底，.dg-light 是白底。 */
.fig { margin: 0; }
.fig figcaption { margin-top: 8px; font-size: .78rem; line-height: 1.6; color: var(--steel-400); }
.dg { position: relative; aspect-ratio: 1 / var(--ratio); margin: 8px 0 34px 36px; container-type: inline-size;
  --line: rgba(255,255,255,.5); --grid: rgba(255,255,255,.07); --axis: #fff; --label: var(--steel-200); --no: rgba(255,255,255,.2); --no-label: rgba(255,255,255,.34); --dim: var(--steel-400); --paper: var(--navy-900); --person: rgba(255,255,255,.3); }
.dg-light { --line: var(--steel-400); --grid: rgba(8,19,27,.06); --axis: var(--navy-900); --label: var(--steel-600); --no: #d3dbe0; --no-label: #a7b4bc; --dim: var(--steel-500); --paper: #fff; --person: var(--steel-200); }
.dg-light + figcaption { color: var(--steel-500); }
.dg-clip { position: absolute; inset: 0; overflow: hidden; border-left: 2px solid var(--axis); border-bottom: 2px solid var(--axis);
  background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px), linear-gradient(to top, var(--grid) 1px, transparent 1px);
  background-size: calc(1000 / var(--world) * 100%) calc(1000 / (var(--world) * var(--ratio)) * 100%); background-position: left bottom; transition: background-size .5s cubic-bezier(.32,.72,0,1); }
.dg-m, .dg-part, .dg-who { position: absolute; left: 0; bottom: 0; width: calc(var(--w) / var(--world) * 100%); height: calc(var(--h) / (var(--world) * var(--ratio)) * 100%); }
.dg-m { border: solid var(--line); border-width: 1px 1px 0 0; color: var(--label); transition: border-color .25s, color .25s, width .5s cubic-bezier(.32,.72,0,1), height .5s cubic-bezier(.32,.72,0,1); }
/* 標籤墊一層底色、疊在工件與框線上面：工件剛好跟某台一樣大時，那台的標籤也看得到 */
.dg-m b { position: absolute; z-index: 3; right: 7px; top: 6px; background: var(--paper); font: 700 .9rem/1 var(--font-num); letter-spacing: .03em; white-space: nowrap; transition: opacity .2s; }
.dg-m.lab-out b { top: auto; bottom: calc(100% + 5px); }
.dg-m.lab-right b { right: auto; left: calc(100% + 7px); }
.dg-m.is-fit { z-index: 2; border-color: var(--orange); border-width: 2px 2px 0 0; color: var(--orange); }
.dg-m.is-no { border-color: var(--no); color: var(--no-label); }
.dg-part { z-index: 1; min-width: 2px; min-height: 2px; border: solid var(--orange); border-width: 2px 2px 0 0;
  background: repeating-linear-gradient(135deg, rgba(232,98,15,.5) 0 1px, transparent 1px 7px), color-mix(in srgb, var(--orange) 16%, var(--paper));
  transition: width .5s cubic-bezier(.32,.72,0,1), height .5s cubic-bezier(.32,.72,0,1); }
.dg.is-zoomed .dg-m:not(:first-child) b { opacity: 0; }
.dg-who { left: auto; right: calc(240 / var(--world) * 100%); width: auto; transition: height .5s cubic-bezier(.32,.72,0,1); }
.dg-person { width: auto; height: 100%; fill: var(--person); }
.dg-who b { position: absolute; left: 50%; bottom: calc(100% + 5px); transform: translateX(-50%); font: 700 .85rem/1 var(--font-num); color: var(--dim); white-space: nowrap; }
.dim { position: absolute; color: var(--dim); pointer-events: none; transition: width .5s cubic-bezier(.32,.72,0,1), height .5s cubic-bezier(.32,.72,0,1); }
.dim b { position: absolute; left: 50%; top: 50%; padding: 0 8px; background: var(--paper); font: 700 .9rem/1 var(--font-num); letter-spacing: .04em; white-space: nowrap; }
.dim-x { left: 0; top: calc(100% + 10px); width: calc(var(--d) / var(--world) * 100%); height: 11px; border-inline: 1px solid; }
.dim-x::before { content: ""; position: absolute; inset: 50% 0 auto; border-top: 1px solid; }
.dim-x b { transform: translate(-50%, -50%); }
.dim-y { right: calc(100% + 10px); bottom: 0; width: 11px; height: calc(var(--d) / (var(--world) * var(--ratio)) * 100%); border-block: 1px solid; }
.dim-y::before { content: ""; position: absolute; inset: 0 auto 0 50%; border-left: 1px solid; }
.dim-y b { transform: translate(-50%, -50%) rotate(-90deg); }
@container (max-width: 440px) {
  .dg-m b, .dim b, .dg-who b { font-size: .78rem; }
  .dg-m b { right: 4px; top: 3px; }
  .dg-m.lab-right b { left: calc(100% + 4px); }
}
/* 龍門銑床畫虛線，跟 CNC 設備分開 */
.dg-m.is-mill { border-style: dashed; }

/* ---------- 可放入工件長度比例條 ----------
   加工服務總覽卡片的小圖：一條代表一種長度（--l，mm），從左邊的基準線量起；--world 是橫向全長（mm）。 */
.lb { position: relative; width: 132px; aspect-ratio: 132 / 76; }
.lb-clip { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 5px; padding-top: 8px;
  border-left: 1.5px solid var(--steel-400); border-bottom: 1.5px solid var(--steel-400); background-color: #f6f8f9; }
.lb-clip i { position: relative; flex: none; height: 14px; width: calc(var(--l) / var(--world) * 100%); border: 1.5px solid var(--orange); border-left: 0; background: rgba(232,98,15,.14); }
@media (prefers-reduced-motion: no-preference) {
  html.js .dg-intro.in .dg-m { animation: plot .9s cubic-bezier(.32,.72,0,1) backwards; animation-delay: calc(var(--i) * 90ms + 120ms); }
  html.js .dg-intro:not(.in) .dg-m { opacity: 0; }
  .dg-part.is-demo { animation: part-in .8s cubic-bezier(.32,.72,0,1); }
}
@keyframes plot { from { clip-path: inset(100% 100% 0 0); opacity: .3; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes part-in { from { width: 0; height: 0; opacity: 0; } }

/* ---------- 列印用抬頭（平常不顯示） ---------- */
.print-head { display: none; }

/* =================== Responsive =================== */
@media (max-width: 1140px) {
  .header-phone { display: none; }
  .main-nav > a, .nav-item > a { padding: 10px 10px; }
  .sub-toggle { margin-left: -8px; }
  .sub-wide { left: -90px; } /* 視窗窄的時候往左挪，右邊才不會超出畫面 */
  .wp-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  :root { --header-h: 66px; }
  .topbar { display: none; }
  /* 頁首的毛玻璃效果（backdrop-filter）會讓頁首變成固定定位的參考框，手機選單只剩頁首那麼高、後面被截掉。手機上不用毛玻璃。 */
  .site-header { backdrop-filter: none; background: var(--white); }
  .menu-toggle { display: block; }
  .header-actions .btn { display: none; }
  .main-nav { position: fixed; inset: var(--header-h) 0 0 0; background: var(--white); flex-direction: column; align-items: stretch; gap: 0; padding: 12px 24px 120px; opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s, visibility 0s .2s; overflow-y: auto; visibility: hidden; }
  .main-nav.open { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
  .main-nav > a, .nav-item > a { padding: 18px 4px; font-size: 1.1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .main-nav a[aria-current="page"]::after { display: none; }
  .main-nav .nav-cta { margin-top: 20px; background: var(--orange); color: #fff; text-align: center; border-radius: var(--radius); border: 0; }
  /* 下拉選單在手機上：名稱照常連到該頁，右邊的箭頭展開子項 */
  .nav-item { flex-wrap: wrap; border-bottom: 1px solid var(--line); }
  .nav-item > a { flex: 1; border-bottom: 0; }
  .sub-toggle { width: 52px; height: 56px; margin: 0; }
  .sub-toggle svg { width: 14px; height: 9px; }
  .sub-menu, .sub-wide { position: static; flex-basis: 100%; display: none; min-width: 0; padding: 0 0 14px 14px; border: 0; border-radius: 0; box-shadow: none; opacity: 1; visibility: visible; transform: none; transition: none; }
  .nav-item.open > .sub-menu { display: block; }
  .sub-menu::before { display: none; }
  .sub-menu a { padding: 11px 4px; font-size: 1rem; white-space: normal; }
  .sub-menu a:hover { background: none; }
  .sub-title, .sub-wide .sub-title { padding: 12px 4px 2px; }
  .sub-wide .sub-links { display: block; margin-top: 6px; padding-top: 6px; }
  .spec-grid { grid-template-columns: repeat(3, 1fr); }
  .spec-grid .spec-title { grid-column: 1 / -1; }
  .spec-item:nth-child(2) { border-left: 0; }
  .spec-item { border-top: 1px solid var(--line); }
  .feature-grid, .case-grid, .values { grid-template-columns: 1fr 1fr; }
  .split, .detail-grid, .contact-grid, .cta-band .wrap { grid-template-columns: 1fr; }
  .split-media .badge { left: 12px; bottom: 12px; }
  .split-fill .split-frame { min-height: 0; aspect-ratio: 4 / 3; }
  .fit, .eq-pick { grid-template-columns: 1fr; }
  .catalog-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .steps { grid-template-columns: 1fr 1fr; }
  .step::after { display: none; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(3) { border-left: 0; }
  .facts div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .hero-caption { bottom: 110px; }
  /* mobile action bar */
  .mobile-bar { display: grid; grid-template-columns: 1fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px -10px rgba(8,19,27,.3); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); gap: 8px; }
  .mobile-bar a { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: var(--radius); font-weight: 700; text-decoration: none; }
  .mobile-bar svg { width: 18px; height: 18px; fill: currentColor; }
  .mobile-bar .call { background: var(--navy-900); color: #fff; }
  .mobile-bar .quote { background: var(--orange); color: #fff; }
  body { padding-bottom: 72px; }
}
@media (max-width: 640px) {
  .wrap { width: calc(100% - 36px); }
  body { font-size: 15.5px; }
  .brand { --bn: 17px; gap: 10px; }
  .brand-logo { height: 32px; }
  .brand-text small { margin-top: 3px; }
  .hero-inner { padding-bottom: 130px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .hero .lead .nb { white-space: normal; }
  .spec-item { padding: 14px 12px; }
  .spec-item .value { font-size: 2.1rem; }
  .feature-card .media { aspect-ratio: 16 / 9; }
  .wp-block { margin-top: 44px; }
  .feature-grid, .case-grid, .values, .steps, .wp-grid, .why-grid, .check-list, .form-grid, .facts { grid-template-columns: 1fr; }
  .facts div { border-left: 0 !important; border-top: 1px solid var(--line); }
  .facts div:first-child { border-top: 0; }
  .wp-item { display: grid; grid-template-columns: 44px 1fr; gap: 4px 16px; text-align: left; padding: 18px; }
  .wp-item svg { grid-row: span 2; margin: 0; }
  /* 手機上頁尾的兩組連結並排，公司介紹與聯絡資訊各佔一整列，頁尾短一些 */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 18px; padding-top: 48px; }
  .footer-grid > div:first-child, .footer-grid > div:last-child { grid-column: 1 / -1; }
  .why-item { padding: 26px 22px; }
  .why-top { min-height: 0; margin-bottom: 14px; }
  .hero-caption { display: none; }
  .section-head > .btn { align-self: stretch; }
  .eq-table, .eq-table.compact { min-width: 0; }
  .eq-table th, .eq-table td, .eq-table.compact th, .eq-table.compact td { padding: 11px 8px; }
  .eq-table .col-type { display: none; }
  .eq-table .num { font-size: 1.08rem; }
  .eq-table tbody td:first-child { white-space: normal; }
  .eq-table .eq-group th { padding: 10px 8px; }
  .eq-table .eq-group th span { display: block; margin: 2px 0 0; }
  .vs-table th, .vs-table td { padding: 12px 10px; font-size: .9rem; }
  .vs-table thead th { font-size: .95rem; }
  .vs-table tbody th { width: 4em; font-size: .8rem; white-space: normal; }
  .catalog-card { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 18px; }
  .lb { width: 96px; }
  .glyph { grid-row: span 2; width: 72px; height: 47px; margin: 0; }
  .wp-item { grid-template-columns: 72px 1fr; align-items: center; }
  .steps.steps-compact { grid-template-columns: 1fr 1fr; gap: 10px; }
  .steps-compact .step { padding: 14px; gap: 10px; }
  .steps-compact .step::before { font-size: 1.6rem; }
  /* 依圖整件代工：手機上每一步一列，編號在左，標籤在右上 */
  .turnkey { margin-top: 48px; padding-top: 40px; }
  .steps.steps-5 { gap: 10px; }
  .steps-5 .step { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; padding: 16px 16px 16px 14px; }
  .steps-5 .step::before { grid-row: span 2; margin: 0; font-size: 2rem; }
  .steps-5 .step h3 { margin: 0 70px 2px 0; font-size: 1.05rem; }
  .steps-5 .step p { grid-column: 2; }
  .step .by { top: 15px; right: 14px; }
  .turnkey-line { padding: 14px 16px; }
  .fit-f input { font-size: 1.45rem; }
  .fit-pre { flex-wrap: nowrap; margin-inline: -18px; padding-inline: 18px; overflow-x: auto; scrollbar-width: none; }
  .fit-pre::-webkit-scrollbar { display: none; }
  .fit-pre > * { flex: none; }
  .fit-go .btn { flex: 1 1 100%; }
  .form-foot .btn { flex: 1 1 100%; }
  .facts-lg .num { font-size: 2.1rem; }
}

/* 觸控裝置：把小的連結與按鈕加高，比較好按 */
@media (max-width: 380px) {
  .brand { --bn: 16px; gap: 9px; }
  .brand-logo { height: 30px; }
}
@media (max-width: 339px) {
  .brand { --bn: 14.4px; gap: 8px; }
  .brand-logo { height: 26px; }
}
@media (pointer: coarse) {
  .site-footer li { margin-bottom: 0; }
  .site-footer li a { display: inline-block; padding: 8px 0; }
  .fit-chip, .catalog-filters button { min-height: 44px; }
  .link-arrow { padding: 9px 0; }
  .side-card li a { padding: 13px 0; }
}

/* =================== Print =================== */
/* 一般列印：拿掉導覽、頁尾與按鈕。按「列印設備規格」時（body.print-sheet）只印設備表與比例圖，並加上公司抬頭。 */
@media print {
  @page { size: A4; margin: 14mm; }
  body { padding: 0 !important; font-size: 10.5pt; }
  .topbar, .site-header, .site-footer, .mobile-bar, .cta-band, .skip, .preview-ribbon, .btn, .catalog-filters, .map-frame, .sidebar, .breadcrumb, .fit-form, .fit-pre, .fit-go, .eyebrow { display: none !important; }
  .section, .section-tight { padding: 6mm 0 3mm; }
  .section-alt, .section-dark, .blueprint { background: none !important; color: #000; }
  .blueprint::before { display: none; }
  .section-dark p, .fit-copy > p, .fit .fit-note, .fig figcaption { color: #333 !important; }
  .fit .fit-res { color: #000; background: none; border-left-color: #000; padding: 0 0 0 10px; }
  .fit, .fit-full .fit { display: block; }
  .fit-draw { grid-template-columns: 1.1fr 1fr; align-items: end; gap: 8mm; margin-top: 4mm; }
  .dg { --line: #555; --grid: rgba(0,0,0,.07); --axis: #000; --label: #333; --no: #bbb; --no-label: #888; --dim: #555; --paper: #fff; --person: #bbb; }
  .dg, .dg * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .dg-m { opacity: 1 !important; animation: none !important; }
  .eq-table thead th { background: none; color: #000; border-bottom: 1.5pt solid #000; }
  .eq-table th, .eq-table td { padding: 6px 10px; }
  .eq-table .type, .eq-table .type.big { padding: 0; background: none; color: #000; }
  .eq-table tr.is-fit, .eq-table .hl-row { background: none; }
  .table-wrap { border: 0; overflow: visible; }
  .eq-table { min-width: 0; }
  h1 { font-size: 22pt; } h2 { font-size: 15pt; } h3 { font-size: 11.5pt; }
  .section-head { margin-bottom: 5mm; }
  .page-hero { background: none; color: #000; }
  .page-hero::before, .page-hero .bg { display: none; }
  .page-hero p { color: #333; }
  .page-hero .wrap { padding: 0 0 4mm; }
  .print-sheet main > :not(.sheet), .print-sheet .sheet h2, .print-sheet .sheet .section-head p, .print-sheet .fit-copy > p:not(.fit-res):not(.fit-note), .print-sheet .fit-copy h2 { display: none !important; }
  .print-sheet .sheet { padding-top: 0; }
  .print-sheet .print-head { display: grid; grid-template-columns: auto 1fr auto; gap: 5mm; align-items: center; margin-bottom: 6mm; padding-bottom: 5mm; border-bottom: 1.5pt solid #000; }
  .print-head .brand-logo { height: 10mm; width: auto; color: #000; }
  .print-head .brand-name { height: 6mm; color: #000; margin-bottom: 1.2mm; }
  .print-head strong { display: block; font-size: 14pt; }
  .print-head span { font-size: 9.5pt; }
  .print-head p { margin: 0; font-size: 8.5pt; line-height: 1.5; text-align: right; }
}
