/* 前方顧問有限公司 — 網站樣式
   設計概念：機電圖紙。網格紙底、管線色（冰水藍 / 冷卻水青）、圖框標題欄（title block）。 */

:root {
  --ink: #1E2430;
  --ink-2: #3A4454;
  --muted: #5B6675;
  --paper: #F4F6F8;
  --sheet: #FFFFFF;
  --line: #CED6DE;
  --grid: #E3E8EE;
  --chw: #0047AB;
  --chw-soft: #E6EEF9;
  --cw: #23847F;
  --amber: #C98A00;
  --amber-soft: #FFF5DA;
  --red: #B23A2E;
  --ok: #2B7A3D;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
  --font-num: "Barlow Semi Condensed", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --w: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --r: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--chw); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3, h4 { font-family: var(--font-num); line-height: 1.3; margin: 0 0 .6em; letter-spacing: .01em; }
h1 { font-size: clamp(28px, 4.2vw, 44px); font-weight: 700; }
h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; }
h3 { font-size: 20px; font-weight: 700; }
h4 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 1em; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.2) blur(6px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand-logo { display: block; height: clamp(30px, 4.2vw, 40px); width: auto; max-width: 62vw; }
.logo-mark { width: 36px; height: 36px; color: var(--ink); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: .06em; }
.brand-en { font-family: var(--font-num); font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }

.nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; align-items: center; }
.nav-list > li { position: relative; display: flex; align-items: center; }
.nav-list a { display: block; padding: 10px 12px; color: var(--ink); text-decoration: none; font-size: 15px; border-bottom: 2px solid transparent; }
.nav-list > li > a.is-active, .nav-list > li > a[aria-current] { border-bottom-color: var(--chw); color: var(--chw); }
.nav-list a:hover { color: var(--chw); }
.sub-toggle { border: 0; background: none; width: 22px; height: 30px; cursor: pointer; padding: 0; margin-left: -8px; color: var(--muted); }
.sub-toggle::before { content: ""; display: inline-block; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); }
.sub { list-style: none; margin: 0; padding: 6px 0; position: absolute; top: 100%; left: 0; min-width: 250px; background: var(--sheet); border: 1px solid var(--line); border-top: 3px solid var(--chw); display: none; }
.sub a { padding: 8px 16px; font-size: 14.5px; border: 0; }
.sub a[aria-current] { color: var(--chw); font-weight: 700; }
.has-sub:hover > .sub, .has-sub:focus-within > .sub, .has-sub.open > .sub { display: block; }
.nav-toggle { display: none; border: 1px solid var(--line); background: var(--sheet); border-radius: var(--r); padding: 8px 12px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; align-items: center; gap: 8px; }
.bars, .bars::before, .bars::after { display: block; width: 18px; height: 2px; background: var(--ink); position: relative; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -6px; } .bars::after { top: 6px; }

@media (max-width: 1060px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--sheet); border-bottom: 1px solid var(--line); max-height: calc(100vh - 68px); overflow-y: auto; }
  .site-nav.open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; padding: 8px var(--gutter) 16px; }
  .nav-list > li { flex-wrap: wrap; justify-content: space-between; border-bottom: 1px solid var(--grid); }
  .nav-list > li > a { flex: 1; padding: 12px 0; border-bottom: 0; }
  .sub-toggle { width: 44px; height: 44px; margin: 0; }
  .sub { position: static; display: none; width: 100%; border: 0; border-left: 3px solid var(--chw); margin: 0 0 10px; min-width: 0; }
  .has-sub:hover > .sub { display: none; }
  .has-sub.open > .sub { display: block; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; font: inherit; font-weight: 500; border-radius: var(--r); text-decoration: none; cursor: pointer; border: 1.5px solid var(--ink); line-height: 1.3; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--chw); border-color: var(--chw); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--sheet); color: var(--chw); border-color: var(--chw); }
.btn-sm { padding: 7px 14px; font-size: 14px; }

/* ---------- Hero ---------- */
.hero { background: var(--sheet); border-bottom: 1px solid var(--line); padding: clamp(28px, 6vw, 72px) 0 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero-title { font-family: var(--font); font-size: clamp(28px, 3.5vw, 42px); line-height: 1.3; text-wrap: balance; letter-spacing: .02em; font-weight: 700; margin-bottom: .5em; }
.hero-text { font-size: clamp(16px, 1.6vw, 18px); color: var(--ink-2); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-schematic { margin: 0; border: 1px solid var(--line); background: var(--sheet); }
.hero-schematic svg { display: block; width: 100%; height: auto; }
.hero-schematic figcaption { font-size: 13px; color: var(--muted); padding: 8px 12px; border-top: 1px solid var(--line); }
.eq-body { fill: var(--sheet); stroke: var(--ink); stroke-width: 2; }
.eq-line { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.tag { font-family: var(--font-num); font-size: 14px; font-weight: 600; text-anchor: middle; fill: var(--ink); }
.pipe { fill: none; stroke-width: 4; }
.pipe.chw { stroke: var(--chw); }
.pipe.cw { stroke: var(--cw); }
.pipe.ret { stroke-dasharray: 10 6; stroke-width: 3; }
.flow { fill: none; stroke: #fff; stroke-width: 2; stroke-dasharray: 2 22; animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -24; } }
.readout rect { fill: var(--ink); }
.readout text { fill: #fff; font-family: var(--font-num); font-size: 13px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .flow { animation: none; display: none; } }

.hero-block { margin: clamp(28px, 5vw, 56px) 0 0; display: grid; grid-template-columns: repeat(4, 1fr); border: 2px solid var(--ink); border-bottom: 0; background: var(--sheet); }
.hero-block > div { padding: 14px 18px; border-left: 1px solid var(--ink); }
.hero-block > div:first-child { border-left: 0; }
.hero-block dt { font-size: 13px; color: var(--muted); }
.hero-block dd { margin: 0; font-family: var(--font-num); font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; line-height: 1.2; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-block { grid-template-columns: repeat(2, 1fr); }
  .hero-block > div:nth-child(3) { border-left: 0; }
  .hero-block > div:nth-child(n+3) { border-top: 1px solid var(--ink); }
}

/* ---------- Page head ---------- */
.page-head {
  background: var(--sheet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M24 0H0V24' fill='none' stroke='%23E8ECF1'/%3E%3C/svg%3E");
  border-bottom: 1px solid var(--line);
  padding: clamp(28px, 5vw, 56px) 0 clamp(22px, 3vw, 36px);
}
.crumb { font-size: 14px; color: var(--chw); font-weight: 500; margin-bottom: .4em; }
.page-head h1 { max-width: 22em; }
.page-desc { font-size: 17px; color: var(--ink-2); max-width: 46em; margin: 0; }

/* ---------- Prose ---------- */
.prose { padding-top: clamp(28px, 4vw, 48px); padding-bottom: clamp(40px, 6vw, 80px); }
.prose > :where(p, ul, ol, h2, h3, h4, blockquote, .lead) { max-width: 46em; }
.prose h2 { margin-top: 2em; padding-top: .6em; border-top: 2px solid var(--ink); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .2em 0; }
.prose blockquote { margin: 1.2em 0; padding: .4em 1.2em; border-left: 4px solid var(--chw); background: var(--chw-soft); }
.prose code { font-size: .92em; background: var(--grid); padding: 1px 5px; border-radius: 3px; }
.prose img { height: auto; border: 1px solid var(--line); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.lead p { font-size: clamp(17px, 1.8vw, 20px); line-height: 1.8; color: var(--ink-2); }

.table-wrap { overflow-x: auto; margin: 1em 0 1.6em; border: 1px solid var(--line); background: var(--sheet); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.55; }
th, td { border-bottom: 1px solid var(--grid); padding: 9px 12px; text-align: left; vertical-align: top; }
th { background: var(--ink); color: #fff; font-weight: 500; white-space: nowrap; }
tbody tr:nth-child(even) td { background: #FAFBFC; }
td.num, th.num { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ---------- Containers ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0; margin: 1.4em 0 2em; border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--sheet); }
.card { padding: 22px 22px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; }
.card h3 { margin-top: 0; font-size: 19px; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card:has(h3 a):hover { background: var(--chw-soft); }
.card:has(h3 a):hover h3 a { color: var(--chw); }
.card-body p:last-child, .card-body ul:last-child { margin-bottom: 0; }
.card-body { font-size: 15px; color: var(--ink-2); }

.steps { list-style: none; counter-reset: step; padding: 0 !important; margin: 1.4em 0 2em; max-width: 52em; }
.step { counter-increment: step; position: relative; padding: 0 0 22px 64px; margin: 0 !important; }
.step::before { content: counter(step); position: absolute; left: 0; top: 0; width: 42px; height: 42px; border: 2px solid var(--chw); background: var(--sheet); color: var(--chw); font-family: var(--font-num); font-weight: 700; font-size: 20px; display: grid; place-items: center; border-radius: 50%; z-index: 1; }
.step::after { content: ""; position: absolute; left: 20px; top: 42px; bottom: 0; width: 2px; background: var(--chw); opacity: .35; }
.step:last-child::after { display: none; }
.step h3 { margin: 6px 0 .4em; font-size: 18.5px; }
.step-body { color: var(--ink-2); }
.step-body p:last-child, .step-body ul:last-child { margin-bottom: 0; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: clamp(20px, 3vw, 40px); margin: 1.4em 0 2em; }
.col h3 { margin-top: 0; padding-bottom: .4em; border-bottom: 1px solid var(--line); }

.note { max-width: 52em; border: 1px solid var(--line); border-left: 4px solid var(--chw); background: var(--sheet); padding: 14px 18px; margin: 1.4em 0; font-size: 15px; }
.note p:last-child, .note ul:last-child { margin-bottom: 0; }
.note-warn { border-left-color: var(--amber); background: var(--amber-soft); }
.note-law { border-left-color: var(--ink); }
.refs { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 2.5em; padding-top: 1em; max-width: 52em; }

.proj-total { color: var(--muted); }
.projects { columns: 2 380px; column-gap: 40px; margin: 1em 0 2em; }
.proj-group { break-inside: avoid; margin: 0 0 28px; background: var(--sheet); border: 1px solid var(--line); }
.proj-group header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 16px; border-bottom: 2px solid var(--ink); }
.proj-group h2 { border: 0 !important; margin: 0 !important; padding: 0 !important; font-size: 19px; }
.proj-group .count { font-family: var(--font-num); font-weight: 600; color: var(--chw); white-space: nowrap; }
.proj-group ul { list-style: none; margin: 0; padding: 4px 16px 10px; font-size: 14.5px; }
.proj-group li { padding: 6px 0; border-bottom: 1px dashed var(--grid); }
.proj-group li:last-child { border-bottom: 0; }

.toc { border: 1px solid var(--line); background: var(--sheet); padding: 14px 18px; margin: 0 0 2em; max-width: 46em; }
.toc-title { font-weight: 700; margin-bottom: .3em; }
.toc ol { margin: 0; padding-left: 1.4em; columns: 2 220px; font-size: 15px; }

.home-body > h2 { max-width: none; }

/* ---------- Tools ---------- */
.tool { background: var(--sheet); border: 1px solid var(--line); border-top: 4px solid var(--chw); padding: clamp(16px, 3vw, 28px); margin: 1.6em 0 2.4em; }
.tool h3 { margin-top: 0; }
.tool-intro { color: var(--muted); font-size: 14.5px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 18px; margin: 12px 0 18px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.field > span { color: var(--ink-2); font-weight: 500; }
.field small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
input[type=number], input[type=text], input[type=date], select, textarea {
  font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid #AEB8C3; border-radius: var(--r); background: #fff; color: var(--ink); width: 100%; min-height: 40px;
}
input:focus, select:focus, textarea:focus { border-color: var(--chw); outline: 2px solid var(--chw-soft); }
.checks { display: grid; gap: 6px; }
.checks label { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; }
.checks input { margin-top: 5px; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 12px; }
.result { border: 2px solid var(--ink); padding: 14px 18px; margin: 16px 0; background: #fff; }
.result h4 { margin: 0 0 .4em; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); margin: 10px 0; }
.kv > div { padding: 10px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kv dt { font-size: 12.5px; color: var(--muted); }
.kv dd { margin: 0; font-family: var(--font-num); font-size: clamp(18px, 2.2vw, 22px); font-weight: 700; line-height: 1.3; }
.pass { color: var(--ok); font-weight: 700; }
.fail { color: var(--red); font-weight: 700; }
.warn { color: var(--amber); font-weight: 700; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 13px; font-weight: 700; border: 1.5px solid currentColor; }
.calc-steps { font-size: 14px; background: #FAFBFC; border: 1px dashed var(--line); padding: 10px 14px; margin: 10px 0; }
.calc-steps ol { margin: 0; padding-left: 1.3em; }
.tabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 2px solid var(--ink); margin-bottom: 18px; }
.tabs button { font: inherit; font-size: 14.5px; border: 1px solid var(--line); border-bottom: 0; background: #F7F9FB; padding: 9px 14px; cursor: pointer; margin-right: -1px; color: var(--ink-2); }
.tabs button[aria-selected=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabpanel[hidden] { display: none; }
.chart-box { position: relative; height: 320px; margin: 10px 0 20px; }
.meter { height: 14px; background: var(--grid); border-radius: 7px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--chw); }
.scale { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; margin: 12px 0; }
.scale > div { text-align: center; padding: 6px 2px; font-family: var(--font-num); font-weight: 700; font-size: 15px; color: #fff; }
.scale > div.on { outline: 3px solid var(--ink); outline-offset: 1px; }
details.fold { border: 1px solid var(--line); background: #fff; margin: 10px 0; }
details.fold > summary { cursor: pointer; padding: 10px 14px; font-weight: 700; }
details.fold > div { padding: 0 14px 12px; }

/* ---------- Footer / title block ---------- */
.site-footer { background: var(--paper); padding: 40px 0 28px; border-top: 1px solid var(--line); }
.titleblock { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); border: 2px solid var(--ink); background: var(--sheet); font-size: 14px; }
.tb-cell { padding: 10px 14px; border-left: 1px solid var(--ink); border-top: 1px solid var(--ink); display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.tb-cell:nth-child(-n+4) { border-top: 0; }
.tb-firm { grid-row: span 2; flex-direction: row; gap: 12px; align-items: flex-start; border-left: 0; border-top: 0; }
.tb-mark { width: 64px; height: auto; flex: none; margin-top: 2px; }
.tb-name { font-weight: 700; font-size: 17px; margin: 0; letter-spacing: .05em; }
.tb-en { font-family: var(--font-num); color: var(--muted); margin: 0; }
.tb-tag { margin: 6px 0 0; color: var(--ink-2); }
.tb-k { font-size: 12px; color: var(--muted); }
.tb-v a { color: var(--ink); }
.fine { font-size: 12.5px; color: var(--muted); margin-top: 16px; max-width: 70em; }
@media (max-width: 860px) {
  .titleblock { grid-template-columns: 1fr 1fr; }
  .tb-firm { grid-column: 1 / -1; grid-row: auto; border-bottom: 1px solid var(--ink); }
  .tb-cell { border-top: 1px solid var(--ink) !important; }
  .tb-cell:nth-child(2n) { border-left: 0; }
  .tb-firm + .tb-cell { border-top: 0 !important; }
  .tb-firm + .tb-cell + .tb-cell { border-top: 0 !important; }
}
@media (max-width: 480px) {
  .titleblock { grid-template-columns: 1fr; }
  .tb-cell { border-left: 0 !important; }
  .tb-firm + .tb-cell + .tb-cell { border-top: 1px solid var(--ink) !important; }
}

/* ---------- Print（表格列印） ---------- */
#print-area { display: none; }
@media print {
  #print-area { display: block; }
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; font-size: 11pt; }
  .site-header, .site-footer, .page-head .page-desc, .tool-actions, .no-print, .skip, .toc { display: none !important; }
  .prose { padding: 0; }
  .tool { border: 0; padding: 0; margin: 0; }
  body.printing-form > *:not(#print-area) { display: none !important; }
  #print-area .no-print { display: none !important; }
  #print-area input { border: 0; border-bottom: 1px solid #000; border-radius: 0; min-height: 0; padding: 2px; }
  th { background: #fff !important; color: #000 !important; border: 1px solid #000; }
  td { border: 1px solid #000; }
  .table-wrap { overflow: visible; border: 0; }
  a { color: #000; text-decoration: none; }
}

.count-table td { vertical-align: middle; }
.cnt-cell { white-space: nowrap; }
input.cnt { width: 84px; min-height: 34px; padding: 4px 6px; display: inline-block; margin: 1px 2px 1px 0; }
.count-table th small { font-weight: 400; opacity: .85; }
.sb-ind { border: 1px solid var(--line); padding: 10px 16px 6px; margin: 0 0 14px; background: #FCFDFE; }
.sb-ind legend { font-weight: 700; padding: 0 6px; }
.sb-basic { display: block; font-size: 14.5px; margin: 4px 0 10px; }
.sb-basic small { color: var(--muted); display: block; margin-left: 22px; }
.sb-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 16px; margin-bottom: 10px; }
.sb-sub { font-family: var(--font-num); font-size: 14px; color: var(--muted); margin: 4px 0 6px; text-align: right; }
.ems-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px 20px; margin-bottom: 14px; }
.ems-clock { font-family: var(--font-num); font-weight: 600; background: var(--ink); color: #fff; padding: 4px 10px; margin: 0; font-size: 14px; }
.ems-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .ems-grid { grid-template-columns: 1fr; } }
@media print {
  #print-area table { table-layout: fixed; width: 100%; font-size: 9.5pt; }
  #print-area th, #print-area td { padding: 5px 6px; word-break: break-all; }
}

/* =====================================================================
   V2 視覺：品牌藍 + 機電系統色碼（冰水藍、冷卻水青、電力橙、消防紅、給排水綠、弱電紫）
   ===================================================================== */
:root {
  --brand: #0047AB;
  --navy: #0A2552;
  --navy-2: #12336E;
  --sky: #5AA9FF;
  --c-chw: #0047AB;
  --c-cw: #0B8F8C;
  --c-power: #E07F00;
  --c-fire: #D23C2C;
  --c-water: #2E8B4F;
  --c-ict: #6A4CC2;
  --c-safety: #E6A800;
  --paper: #F3F6FA;
  --shadow: 0 1px 2px rgba(10, 37, 82, .06), 0 8px 24px rgba(10, 37, 82, .08);
}
.sys-chw { --sys: var(--c-chw); }
.sys-cw { --sys: var(--c-cw); }
.sys-power { --sys: var(--c-power); }
.sys-fire { --sys: var(--c-fire); }
.sys-water { --sys: var(--c-water); }
.sys-ict { --sys: var(--c-ict); }
.sys-safety { --sys: var(--c-safety); }

/* 系統色碼條：頁首與頁尾使用的管線色碼帶 */
.pipe-legend { display: grid; grid-template-columns: repeat(6, 1fr); height: 6px; }
.pipe-legend span:nth-child(1) { background: var(--c-chw); }
.pipe-legend span:nth-child(2) { background: var(--c-cw); }
.pipe-legend span:nth-child(3) { background: var(--c-power); }
.pipe-legend span:nth-child(4) { background: var(--c-fire); }
.pipe-legend span:nth-child(5) { background: var(--c-water); }
.pipe-legend span:nth-child(6) { background: var(--c-ict); }

/* Header */
.site-header { border-bottom: 0; box-shadow: 0 1px 0 var(--line); }
.nav-list > li > a.is-active, .nav-list > li > a[aria-current] { color: var(--brand); border-bottom-color: var(--brand); }
.sub { border-top-color: var(--brand); box-shadow: var(--shadow); border-radius: 0 0 6px 6px; }

/* Hero：深藍圖紙 */
.hero {
  background:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px) 0 0 / 24px 24px,
    radial-gradient(1200px 500px at 85% 10%, #1A4A9C 0%, transparent 60%),
    var(--navy);
  color: #fff; border-bottom: 0; padding-bottom: 0;
}
.hero-title { color: #fff; }
.hero-text { color: #C9D8F2; }
.hero .btn-primary { background: #fff; color: var(--navy); border-color: #fff; }
.hero .btn-primary:hover { background: var(--sky); border-color: var(--sky); color: var(--navy); }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.6); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; border-color: #fff; }
.hero-schematic { background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.18); border-radius: 6px; overflow: hidden; }
.hero-schematic rect[fill="url(#grid)"] { opacity: 0; }
.hero-schematic figcaption { color: #AFC3E6; border-top-color: rgba(255,255,255,.15); }
.hero-schematic figcaption a { color: #fff; }
.hero .eq-body { fill: #0E2E63; stroke: #DCE8FF; }
.hero .eq-line { stroke: #DCE8FF; }
.hero .tag { fill: #fff; }
.hero .pipe.chw { stroke: var(--sky); }
.hero .pipe.cw { stroke: #2FD3C4; }
.hero #arr path { fill: var(--sky); }
.hero #arrc path { fill: #2FD3C4; }
.hero .readout rect { fill: var(--c-safety); }
.hero .readout text { fill: var(--navy); }
.hero-block { border: 0; background: transparent; border-top: 1px solid rgba(255,255,255,.25); margin-top: clamp(32px, 5vw, 56px); }
.hero-block > div { border-left: 1px solid rgba(255,255,255,.18); padding: 18px 20px 22px; }
.hero-block dt { color: #AFC3E6; }
.hero-block dd { color: #fff; }
.hero-block > div:nth-child(1) dd { color: var(--sky); }
.hero-block > div:nth-child(2) dd { color: #FFC24D; }
.hero-block > div:nth-child(3) dd { color: #FFC24D; }
.hero-block > div:nth-child(4) dd { color: #FF8A7A; }
@media (max-width: 860px) { .hero-block > div:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.18); } }

/* 頁首：深藍＋系統色碼條 */
.page-head {
  background:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 24px 24px,
    radial-gradient(900px 400px at 90% 0%, #1A4A9C 0%, transparent 60%),
    var(--navy);
  color: #fff; border-bottom: 0; position: relative;
}
.page-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: linear-gradient(90deg, var(--c-chw) 0 16.66%, var(--c-cw) 16.66% 33.33%, var(--c-power) 33.33% 50%, var(--c-fire) 50% 66.66%, var(--c-water) 66.66% 83.33%, var(--c-ict) 83.33% 100%); }
.page-head h1 { color: #fff; }
.page-desc { color: #C9D8F2; }
.crumb { color: #FFC24D; }

/* 段落標題 */
.prose h2 { border-top: 0; padding-top: 0; position: relative; padding-left: 16px; }
.prose h2::before { content: ""; position: absolute; left: 0; top: .2em; bottom: .2em; width: 5px; border-radius: 3px; background: var(--brand); }
.proj-group h2::before, .band h2::before { display: none; }
.proj-group h2, .band h2 { padding-left: 0 !important; }

/* 卡片：系統色＋圖示 */
.cards { gap: 18px; border: 0; background: transparent; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.card { background: #fff; border: 1px solid #DCE4EE; border-top: 4px solid var(--sys, var(--brand)); border-radius: 8px; padding: 22px 22px 20px; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.card-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; margin-bottom: 12px; color: var(--sys, var(--brand)); background: color-mix(in srgb, var(--sys, var(--brand)) 12%, #fff); }
.card-icon svg { width: 26px; height: 26px; }
.card:has(h3 a):hover { background: #fff; transform: translateY(-3px); box-shadow: 0 2px 4px rgba(10,37,82,.08), 0 16px 32px rgba(10,37,82,.14); }
.card:has(h3 a):hover h3 a { color: var(--sys, var(--brand)); }
.card h3 a::before { content: ""; }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:has(h3 a):hover { transform: none; } }

/* 全幅色帶 */
.band { margin-inline: calc(50% - 50vw); padding-block: clamp(44px, 7vw, 84px); }
.band-inner { max-width: var(--w); margin: 0 auto; padding-inline: var(--gutter); }
.band-inner > :where(p, ul, ol, h2, .table-wrap, .lead) { max-width: 52em; }
.band-inner > .table-wrap { max-width: none; }
.band h2 { font-size: clamp(24px, 3vw, 34px); margin-top: 0 !important; }
.band-white { background: #fff; }
.band-tint { background: linear-gradient(180deg, #EAF1FB, #F3F6FA); }
.band-navy { background:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--navy); color: #DCE8FF; }
.band-navy h2 { color: #fff; }
.band-navy .card { border-color: transparent; }
.band-brand { background: linear-gradient(110deg, var(--brand) 0%, #0A5BD1 55%, #0B8F8C 100%); color: #fff; }
.band-brand h2 { color: #fff; }
.band-brand p { color: #E3EEFF; font-size: 17px; }
.band-brand a { display: inline-block; background: #fff; color: var(--navy); text-decoration: none; padding: 12px 24px; border-radius: 6px; font-weight: 700; }
.band-brand a:hover { background: var(--c-safety); color: var(--navy); }
.home-body { padding-top: 0; padding-bottom: 0; }

/* 步驟 */
.step::before { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 14%, transparent); }
.step::after { background: linear-gradient(var(--brand), var(--c-cw)); opacity: .45; }
.step:nth-child(6n+2)::before { background: var(--c-cw); border-color: var(--c-cw); box-shadow: 0 0 0 5px color-mix(in srgb, var(--c-cw) 14%, transparent); }
.step:nth-child(6n+3)::before { background: var(--c-power); border-color: var(--c-power); box-shadow: 0 0 0 5px color-mix(in srgb, var(--c-power) 14%, transparent); }
.step:nth-child(6n+4)::before { background: var(--c-fire); border-color: var(--c-fire); box-shadow: 0 0 0 5px color-mix(in srgb, var(--c-fire) 14%, transparent); }
.step:nth-child(6n+5)::before { background: var(--c-water); border-color: var(--c-water); box-shadow: 0 0 0 5px color-mix(in srgb, var(--c-water) 14%, transparent); }
.step:nth-child(6n+6)::before { background: var(--c-ict); border-color: var(--c-ict); box-shadow: 0 0 0 5px color-mix(in srgb, var(--c-ict) 14%, transparent); }

/* 表格、欄位、提醒框 */
.table-wrap { border-radius: 8px; border-color: #DCE4EE; box-shadow: 0 1px 2px rgba(10,37,82,.05); }
th { background: var(--navy); }
tbody tr:hover td { background: #EEF4FD; }
.col { background: #fff; border: 1px solid #DCE4EE; border-radius: 8px; padding: 18px 20px; box-shadow: var(--shadow); }
.col h3 { color: var(--navy); border-bottom: 2px solid var(--brand); }
.cols .col:nth-child(6n+2) h3 { border-bottom-color: var(--c-cw); }
.cols .col:nth-child(6n+3) h3 { border-bottom-color: var(--c-power); }
.cols .col:nth-child(6n+4) h3 { border-bottom-color: var(--c-fire); }
.cols .col:nth-child(6n+5) h3 { border-bottom-color: var(--c-water); }
.note { border-radius: 8px; border-left-width: 5px; border-left-color: var(--brand); background: #EEF4FD; border-color: #D3E1F5; border-left-color: var(--brand); }
.note-warn { background: #FFF7E0; border-color: #F2DFA8; border-left-color: var(--c-safety); }
.lead p { color: var(--navy-2); }
.toc { border-radius: 8px; border-left: 5px solid var(--c-cw); }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* 實績 */
.proj-group { border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); border-color: #DCE4EE; }
.proj-group header { background: var(--navy); border-bottom: 0; }
.proj-group h2 { color: #fff; }
.proj-group .count { color: #FFC24D; }
.proj-group:nth-child(6n+2) header { background: #0B4E8C; }
.proj-group:nth-child(6n+3) header { background: #0B6E70; }
.proj-group:nth-child(6n+4) header { background: #2B4C7E; }

/* 工具面板 */
.tool { border-radius: 10px; border-top: 0; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.tool::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--c-chw), var(--c-cw), var(--c-water)); }
#tool-duct-noise::before, #tool-sound-rules::before { background: linear-gradient(90deg, var(--c-fire), var(--c-power)); }
#tool-green-building::before, #tool-bers::before { background: linear-gradient(90deg, var(--c-water), #7BC043); }
#tool-smart-building::before { background: linear-gradient(90deg, var(--c-ict), var(--brand)); }
#tool-ems-demo::before { background: linear-gradient(90deg, var(--c-power), var(--c-safety)); }
#tool-sqc::before, #tool-inspection-matrix::before { background: linear-gradient(90deg, var(--navy), var(--brand)); }
.tabs button { border-radius: 6px 6px 0 0; }
.tabs button[aria-selected=true] { background: var(--brand); border-color: var(--brand); }
.result { border: 0; border-left: 5px solid var(--brand); background: #F5F9FF; border-radius: 8px; box-shadow: inset 0 0 0 1px #D3E1F5; }
.kv { border-radius: 6px; overflow: hidden; background: #fff; }
.btn { border-radius: 6px; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--navy); border-color: var(--navy); }

/* 頁尾：深藍標題欄 */
.site-footer { background: var(--navy); color: #C9D8F2; border-top: 0; padding-top: 0; }
.site-footer > .pipe-legend { margin-bottom: 40px; }
.titleblock { background: transparent; border-color: rgba(255,255,255,.55); }
.tb-cell { border-color: rgba(255,255,255,.3) !important; }
.tb-name { color: #fff; }
.tb-en, .tb-k { color: #8FA8D3; }
.tb-tag { color: #C9D8F2; }
.tb-v, .tb-v a { color: #fff; }
.tb-mark { background: #fff; border-radius: 6px; padding: 6px 8px; width: 72px; }
.fine { color: #8FA8D3; }

/* 首頁碳盤查示意動畫 */
.hero-carbon .cf-title { fill: #AFC3E6; font-size: 13px; font-family: var(--font); }
.hero-carbon .cf-box { fill: rgba(255,255,255,.06); stroke-width: 1.5; }
.hero-carbon .cf-box.c1, .hero-carbon .cf-pipe.c1 { stroke: #FF8A7A; }
.hero-carbon .cf-box.c2, .hero-carbon .cf-pipe.c2 { stroke: #FFC24D; }
.hero-carbon .cf-box.c3, .hero-carbon .cf-pipe.c3 { stroke: #2FD3C4; }
.hero-carbon .cf-h { fill: #fff; font-size: 14.5px; font-weight: 700; font-family: var(--font); }
.hero-carbon .cf-s { fill: #C9D8F2; font-size: 12.5px; font-family: var(--font); }
.hero-carbon .cf-pipe { fill: none; stroke-width: 5; stroke-linecap: round; opacity: .9; }
.hero-carbon .cf-frame { fill: rgba(255,255,255,.04); stroke: rgba(255,255,255,.35); stroke-width: 1.5; }
.hero-carbon .seg.c1 { fill: #FF8A7A; }
.hero-carbon .seg.c2 { fill: #FFC24D; }
.hero-carbon .seg.c3 { fill: #2FD3C4; }
.hero-carbon .cf-pct { fill: #fff; font-family: var(--font-num); font-weight: 700; font-size: 18px; }
.hero-carbon .cf-bar { transform-box: fill-box; transform-origin: 50% 100%; animation: cfgrow 1.6s cubic-bezier(.2,.7,.2,1) .3s both; }
@keyframes cfgrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .hero-carbon .cf-bar { animation: none; } }

/* 首頁數據欄：實績件數＋實績類別明細 */
.hero-block { grid-template-columns: minmax(180px, auto) 1fr; }
.hero-block > div.has-note { display: grid; grid-template-columns: auto 1fr; column-gap: 28px; align-items: center; }
.hero-block > div.has-note dt { grid-column: 1; }
.hero-block > div.has-note dd { grid-column: 1; }
.stat-note { grid-column: 2; grid-row: 1 / span 2; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.stat-note li { font-size: 14px; color: #fff; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.07); border-radius: 999px; padding: 4px 12px; line-height: 1.4; }
@media (max-width: 860px) {
  .hero-block { grid-template-columns: 1fr; }
  .hero-block > div:nth-child(n) { border-left: 0; border-top: 1px solid rgba(255,255,255,.18); }
  .hero-block > div:first-child { border-top: 0; }
  .hero-block > div.has-note { grid-template-columns: 1fr; }
  .stat-note { grid-column: 1; grid-row: auto; margin-top: 10px; }
}

/* =====================================================================
   品牌標誌整合：AC 標誌（名片標誌向量化）＋真實字型字標
   ===================================================================== */
.lockup { display: inline-flex; align-items: center; gap: .75em; color: var(--brand); line-height: 1; }
.lockup .ac-mark { height: 2.6em; width: auto; flex: none; display: block; }
.lk-text { display: inline-grid; gap: .32em; }
.lk-zh, .lk-en { display: block; text-align: justify; text-align-last: justify; white-space: nowrap; }
.lk-zh { font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif; font-weight: 300; font-size: 1.12em; letter-spacing: .38em; margin-right: -.38em; }
.lk-en { font-family: "Barlow Semi Condensed", "Arial Narrow", sans-serif; font-weight: 400; font-size: 1.02em; letter-spacing: .09em; }
.lockup-header { font-size: clamp(12.5px, 1.55vw, 16px); }
.brand-logo { display: none; }
.lockup-footer { color: #fff; font-size: 15px; margin-bottom: 10px; }
.tb-firm .tb-tag { margin-top: 4px; }
.admin-mark { height: 22px; width: auto; color: #fff; }
@media (max-width: 380px) { .lockup-header .lk-zh { letter-spacing: .26em; margin-right: -.26em; } }

/* 標誌浮水印：首頁主視覺、各頁標題區、深色色帶 */
.hero, .page-head, .band-brand, .band-navy { position: relative; overflow: hidden; isolation: isolate; }
.hero-watermark, .head-watermark, .band-watermark { position: absolute; z-index: -1; color: #fff; pointer-events: none; }
.hero-watermark { width: min(760px, 70vw); height: auto; left: -6%; bottom: -18%; opacity: .05; }
.head-watermark { width: 420px; height: auto; right: -40px; top: 50%; transform: translateY(-50%); opacity: .07; }
.page-head.has-illus .head-watermark { display: none; }
.band-watermark { width: 520px; height: auto; right: -60px; bottom: -80px; opacity: .08; }
.band-navy .band-watermark { opacity: .04; left: -80px; right: auto; top: -60px; bottom: auto; }

/* 段落標題標記：取自 C 字的鏤空切口（上下兩段色條） */
.prose h2::before { background: linear-gradient(var(--brand) 0 42%, transparent 42% 58%, var(--brand) 58% 100%); width: 6px; border-radius: 1px; }

/* 實績類別頁 */
.page-head.has-illus .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 32px; align-items: center; }
.page-head.has-illus .wrap > :not(.head-illus) { grid-column: 1; }
.head-illus { grid-column: 2; grid-row: 1 / span 3; width: clamp(180px, 26vw, 320px); height: auto; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
@media (max-width: 760px) { .page-head.has-illus .wrap { grid-template-columns: 1fr; } .head-illus { grid-column: 1; grid-row: auto; width: 100%; max-width: 360px; margin-bottom: 16px; order: -1; } }
.cat-nav { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 28px; }
.cat-nav a { display: inline-flex; align-items: center; gap: 10px; padding: 9px 10px 9px 16px; border-radius: 999px; background: #fff; border: 1px solid #CFDCEF; color: var(--navy); text-decoration: none; font-weight: 500; box-shadow: 0 1px 2px rgba(10,37,82,.06); }
.cat-nav a b { font-family: var(--font-num); background: #E6EEF9; color: var(--brand); border-radius: 999px; padding: 1px 9px; font-size: 14px; }
.cat-nav a:hover { border-color: var(--brand); color: var(--brand); }
.cat-nav a[aria-current] { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat-nav a[aria-current] b { background: rgba(255,255,255,.2); color: #fff; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; margin: 10px 0 30px; }
.proj-card { background: #fff; border: 1px solid #DCE4EE; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.proj-img { margin: 0; aspect-ratio: 16 / 10; background: #E6EEF9; }
.proj-img img { width: 100%; height: 100%; object-fit: cover; display: block; border: 0 !important; }
.proj-img figcaption { font-size: 12px; color: var(--muted); padding: 6px 12px; }
.proj-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.proj-body h3 { margin: 0 !important; font-size: 17px; line-height: 1.45; }
.proj-body p { margin: 0; font-size: 14.5px; color: var(--ink-2); }
.proj-tags { list-style: none; padding: 0 !important; margin: 0 !important; display: flex; flex-wrap: wrap; gap: 6px; }
.proj-tags li { font-size: 12.5px; padding: 2px 9px; border-radius: 999px; background: #EEF4FD; color: var(--brand); margin: 0 !important; }
.proj-link { margin-top: auto; align-self: flex-start; font-size: 14px; font-weight: 500; text-decoration: none; padding: 6px 12px; border-radius: 6px; border: 1px solid #CFDCEF; }
.proj-link:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.stat-note a { color: #fff; text-decoration: none; display: block; }
.stat-note li:has(a):hover { background: #fff; }
.stat-note li:has(a):hover a { color: var(--navy); }
