@charset "utf-8";
/* =========================================================================
   台灣產業 AI 轉型平台 — 全站樣式（基礎層＋「方格」版型）

   這個檔負責：重置、共用元件、版面骨架，以及初版的「方格」外觀
   （docs/DESIGN.md：工廠現場的精準——細線方格、硬邊、安全黃）。

   新版的「弧線」外觀寫在 css/theme-arc.css，用 [data-theme="arc"] 前綴
   蓋在這一層上面。兩套共用同一份 HTML，切換見 js/theme.js。
   **改這個檔等於同時影響兩套版型**，只想改新版就去改 theme-arc.css。
   ========================================================================= */

/* ---------- 1. 設計變數 ------------------------------------------------ */
:root {
  --paper:      #f2f3f0;
  --panel:      #ffffff;
  --ink:        #0e1c19;
  --ink-2:      #3a4f49;
  --muted:      #64756f;
  --rule:       #c8cfc9;
  --rule-soft:  #dee2dc;
  --grid:       rgba(14, 28, 25, .07);
  --accent:     #f2b705;
  --accent-ink: #7a5200;

  /* 三個「淡淡一層」用的顏色：焦點環外圈、墨色底紋、強調色底紋。
     抽成變數是為了讓 theme-arc.css 一次換掉，不用去找散落的 rgba()。 */
  --focus-glow:  rgba(242, 183, 5, .55);
  --ink-wash:    rgba(14, 28, 25, .06);
  --accent-wash: rgba(242, 183, 5, .22);

  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --serif: "Noto Serif TC", "Source Han Serif TC", "PMingLiU", serif;
  --mono: "IBM Plex Mono", ui-monospace, "Consolas", monospace;

  --pad: clamp(20px, 5vw, 64px);
  --gap-sec: clamp(64px, 9vw, 120px);
  --maxw: 1200px;
}

/* ---------- 2. 基礎重置 ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.85;
  font-weight: 400;
  overflow-wrap: break-word;
  word-break: break-word;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
img { background: var(--rule-soft); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  letter-spacing: .01em;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

/* 瀏覽器預設 figure 有 margin: 1em 40px，會讓圖左右縮進去，全部清掉 */
figure { margin: 0; }

a { color: inherit; }

ul, ol { margin: 0; padding: 0; }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--focus-glow);
  border-radius: 1px;
}

::selection { background: var(--accent); color: var(--ink); }

/* ---------- 3. 通用元件 ------------------------------------------------ */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--pad);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  font-size: 15px;
}
.skip:focus { left: 8px; top: 8px; }

/* 等寬小標（英文／編號／規格欄位） */
.tag {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

code, kbd, samp {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--ink-wash);
  border: 1px solid var(--rule-soft);
  padding: 1px 5px;
  word-break: break-all;
}

/* 標註線：小節標題左邊的短橫 */
.mark::before {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: var(--accent);
  margin-bottom: 14px;
}

/* 連結：底線由細變粗 */
.lnk {
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: border-color .18s, color .18s;
}
.lnk:hover { border-bottom-color: var(--ink); }

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 13px 24px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  transition: background .18s, color .18s;
}
.btn:hover { background: var(--accent); color: var(--ink); border-color: var(--accent); }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- 4. 頁首／導覽 ---------------------------------------------- */
.site-head {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-head__in {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 74px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 14px 0;
}

.brand__glyph {
  width: 30px;
  height: 30px;
  flex: none;
}

.brand__name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: .02em;
}

.brand__en {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}

.site-head__in > nav { display: flex; align-items: center; }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
  list-style: none;
  flex-wrap: wrap;
  padding: 0;
}

.nav a {
  font-size: 15px;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: border-color .18s;
  white-space: nowrap;
}
.nav a:hover { border-bottom-color: var(--accent); }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); font-weight: 500; }

/* ---------- 5. 首頁主視覺 ---------------------------------------------- */
.hero {
  border-bottom: 1px solid var(--rule);
  background:
    linear-gradient(to right, var(--grid) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--paper);
}

.hero__in {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding-block: clamp(48px, 8vw, 92px);
}

.hero h1 {
  font-size: clamp(29px, 3.9vw, 46px);
  font-weight: 900;
  line-height: 1.28;
  margin: 18px 0 22px;
  max-width: 16em;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(transparent 62%, var(--accent) 62%, var(--accent) 94%, transparent 94%);
  padding-inline: 2px;
}

.hero__lead {
  font-size: clamp(16px, 1.5vw, 18px);
  color: var(--ink-2);
  max-width: 30em;
}

.hero__cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.hero__fig {
  border: 1px solid var(--rule);
  background: var(--panel);
  padding: 18px 18px 12px;
}

.hero__fig figcaption {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--rule-soft);
  margin-top: 12px;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* 流程圖動畫（reduced-motion 會關掉） */
.flow-live { stroke-dasharray: 6 5; animation: flow 9s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -220; } }

/* ---------- 6. 小節骨架 ------------------------------------------------ */
.sec { padding-block: var(--gap-sec); border-bottom: 1px solid var(--rule); }
.sec:last-of-type { border-bottom: 0; }

.sec__in {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0 clamp(24px, 4vw, 56px);
  align-items: start;
}

.sec__label { position: sticky; top: 104px; }

.sec__label h2 {
  font-size: clamp(20px, 2.1vw, 25px);
  margin-top: 6px;
}

.sec__label p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.7;
}

.sec__body > p { max-width: 34em; color: var(--ink-2); }

.lead-lg,
.sec__body > .lead-lg {
  font-family: var(--serif);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.75;
  color: var(--ink);
  max-width: 26em;
}

/* ---------- 7. 服務清單 ------------------------------------------------ */
.svc { list-style: none; border-top: 1px solid var(--rule); }

.svc > li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 0 18px;
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
}

.svc__no {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent-ink);
  font-weight: 500;
  padding-top: 5px;
  font-variant-numeric: tabular-nums;
}

.svc h3 { font-size: 19px; margin-bottom: 8px; }

.svc p { color: var(--ink-2); max-width: 36em; font-size: 15.5px; }

.svc__does {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 12px;
}

.svc__does li {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--ink-2);
  border: 1px solid var(--rule);
  background: var(--panel);
  padding: 3px 9px;
}

/* ---------- 8. 適用產業 ------------------------------------------------ */
.ind {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.ind > li {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 22px 20px;
  background: var(--panel);
}

.ind h3 {
  font-size: 16.5px;
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 8px;
}

.ind h3 .num { font-size: 12px; color: var(--accent-ink); font-weight: 400; }

.ind p { font-size: 14.5px; color: var(--ink-2); line-height: 1.75; }

/* ---------- 9. 合作流程 ------------------------------------------------ */
.flowsteps { list-style: none; counter-reset: st; border-top: 1px solid var(--rule); }

.flowsteps > li {
  counter-increment: st;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 0 18px;
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}

.flowsteps > li::before {
  content: counter(st, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--accent);
  width: 34px;
  height: 26px;
  display: grid;
  place-items: center;
  margin-top: 2px;
}

.flowsteps h3 { font-size: 17px; margin-bottom: 6px; }
.flowsteps p { font-size: 15px; color: var(--ink-2); max-width: 34em; }

.flowsteps__when {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 4px;
}

/* ---------- 10. 案例卡 -------------------------------------------------- */
.cards {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: clamp(28px, 3.4vw, 48px);
}

.card { border-top: 1px solid var(--ink); padding-top: 14px; }

.card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--rule-soft);
  border: 1px solid var(--rule);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.card a:hover .card__media img { transform: scale(1.035); }

/* 封面圖還沒放上來時的斜線佔位 */
.card__media.is-empty {
  background:
    repeating-linear-gradient(45deg, var(--rule-soft) 0 8px, var(--panel) 8px 16px);
}
.card__media.is-empty::after {
  content: "封面圖待補";
  position: absolute;
  inset: auto 0 0 0;
  text-align: center;
  padding: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
  border-top: 1px solid var(--rule);
}

.card__kind {
  position: absolute;
  left: 0;
  top: 0;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  padding: 4px 10px;
}

.card a { text-decoration: none; display: block; }

.card h3 {
  font-size: 20px;
  margin: 16px 0 6px;
  transition: color .18s;
}

.card a:hover h3 { color: var(--accent-ink); }

.card__sum {
  font-size: 15px;
  color: var(--ink-2);
  margin-bottom: 14px;
  line-height: 1.8;
}

/* 規格表式中繼資料（點線 leader） */
.spec { margin: 0; border-top: 1px solid var(--rule-soft); }

.spec > div {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr);
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dotted var(--rule);
}

.spec dt {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--muted);
  padding-top: 2px;
}

.spec dd {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.7;
}

.card__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
}
.card__more::after { content: "→"; transition: transform .2s; }
.card a:hover .card__more::after { transform: translateX(4px); }

/* 效益區塊：cases.json 該筆有寫 impact 才會出現（沒有真實數字就別寫） */
.card__impact {
  margin-top: 16px;
  border: 1px solid var(--rule-soft);
  border-left: 3px solid var(--accent);
  background: var(--panel);
  padding: 14px 16px;
}

.card__impact .tag { display: block; margin-bottom: 6px; }

.card__impact-fig {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.card__impact-fig b {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.2;
  color: var(--ink);
}

.card__impact-fig span { font-size: 14.5px; color: var(--ink-2); }

.card__impact-note {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}

/* ---------- 11. 篩選列（作品集） --------------------------------------- */
.filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 20px 0;
  margin-bottom: clamp(32px, 4vw, 48px);
}

.filters__row {
  display: flex;
  align-items: baseline;
  gap: 10px 14px;
  flex-wrap: wrap;
}

.filters__row > .tag { flex: none; min-width: 4.5em; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }

.chip {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  padding: 6px 13px;
  border: 1px solid var(--rule);
  background: var(--panel);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.count {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.empty {
  border: 1px dashed var(--rule);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- 12. 案例內頁 ------------------------------------------------ */
.crumb {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
  padding-block: 22px 0;
}
.crumb a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.crumb a:hover { border-bottom-color: var(--ink); }

.case-head { padding-block: clamp(26px, 4vw, 44px) clamp(30px, 4vw, 48px); }

.case-head h1 {
  font-size: clamp(28px, 4.2vw, 46px);
  font-weight: 900;
  margin: 14px 0 16px;
  max-width: 18em;
}

.case-head__sub {
  font-size: clamp(16px, 1.6vw, 18.5px);
  color: var(--ink-2);
  max-width: 32em;
}

.case-head__links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

.case-cover {
  border: 1px solid var(--rule);
  background: var(--panel);
  padding: 10px;
  margin-bottom: clamp(26px, 3vw, 40px);
}
.case-cover img { width: 100%; }
.case-cover figcaption {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  padding: 10px 2px 2px;
  letter-spacing: .04em;
}

/* 內頁規格總表（橫向四欄） */
.specbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--rule);
  margin-bottom: clamp(40px, 5vw, 64px);
}

.specbar > div {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 16px 18px;
  background: var(--panel);
}

.specbar dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.specbar dd { margin: 0; font-size: 15px; line-height: 1.7; }

/* 內文排版 */
.prose { max-width: 36em; }
.prose h3 {
  font-size: 19px;
  margin: 34px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--rule-soft);
}
.prose h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose p { color: var(--ink-2); font-size: 15.5px; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.3em; }
.prose li { color: var(--ink-2); font-size: 15.5px; margin-bottom: .45em; }
.prose strong { color: var(--ink); font-weight: 700; }

/* 人 vs AI 對照表 */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 0;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--rule);
}
.split > div {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 20px;
  background: var(--panel);
}
.split h3 { font-size: 16px; margin-bottom: 12px; }
.split ul { list-style: none; }
.split li {
  font-size: 14.5px;
  color: var(--ink-2);
  padding: 7px 0 7px 18px;
  border-bottom: 1px dotted var(--rule);
  position: relative;
  line-height: 1.7;
}
.split li:last-child { border-bottom: 0; }
.split li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 8px;
  height: 1px;
  background: var(--accent-ink);
}

/* 對照表（例：製程時間與花費比較、效益估算）
   docs/DESIGN.md〈共用骨架〉第 2 條：寬表格要自帶橫向捲動容器，
   所以 <table class="cmp"> 外面一定要包一層 <div class="cmp-wrap">。 */
.cmp-wrap { overflow-x: auto; }

.cmp {
  width: 100%;
  min-width: 520px;          /* 窄螢幕改成在容器裡橫向捲，不讓整頁跑出捲軸 */
  border-collapse: collapse;
  background: var(--panel);
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--rule);
}

.cmp th,
.cmp td {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 13px 15px;
  text-align: left;
  vertical-align: top;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink-2);
}

/* 表格上方那句「這張表在比什麼」。用內文字體，不要套 .tag——
   等寬字＋寬字距的中文長句讀起來很吃力。 */
.cmp caption {
  text-align: left;
  padding: 14px 15px 13px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--muted);
  border-bottom: 1px solid var(--rule);
}

.cmp thead th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

/* 每一列最左邊的項目名 */
.cmp tbody th {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  width: 1%;
}

/* 「我們」那一欄：顏色深一點，讓對照一眼看得出方向 */
.cmp .is-ours { color: var(--ink); }
.cmp tfoot th,
.cmp tfoot td { background: var(--accent-wash); color: var(--ink); font-weight: 700; }

.cmp b { color: var(--ink); }

/* 四欄以上的對照表要寬一點才讀得完，窄螢幕照樣在容器裡橫向捲 */
.cmp--wide { min-width: 760px; }

/* 表格底下那幾行「數字怎麼來的」。寬度沿用 .sec__body > p 的 34em，不另外放寬 */
.cmp-note {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.85;
  margin-top: 16px;
}

/* 圖片藝廊 */
.gallery {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(18px, 2.4vw, 30px);
}

.gallery figure { margin: 0; border: 1px solid var(--rule); background: var(--panel); padding: 8px; }
.gallery img { width: 100%; }
.gallery figcaption {
  font-size: 13.5px;
  color: var(--ink-2);
  padding: 10px 2px 2px;
  line-height: 1.7;
  border-top: 1px solid var(--rule-soft);
  margin-top: 8px;
}
.gallery figcaption b {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 3px;
}

.gallery--wide { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }

/* 注意事項／免責 */
.notice {
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  background: var(--panel);
  padding: 16px 20px;
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.8;
}

.todo {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--accent-ink);
  background: var(--accent-wash);
  padding: 1px 7px;
  white-space: nowrap;
}

/* ---------- 13. 關於頁：夥伴卡 ------------------------------------------ */
.people {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--rule);
}

.people > li {
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 22px 20px 24px;
  background: var(--panel);
}

.people__slot {
  aspect-ratio: 1 / 1;
  max-width: 96px;
  border: 1px solid var(--rule);
  background:
    repeating-linear-gradient(45deg, var(--rule-soft) 0 6px, transparent 6px 12px),
    var(--panel);
  margin-bottom: 16px;
}

.people h3 { font-size: 18px; margin-bottom: 4px; }
.people__role { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); letter-spacing: .05em; }
.people p { font-size: 14.5px; color: var(--ink-2); margin-top: 12px; line-height: 1.75; }

/* ---------- 14. 聯絡 ---------------------------------------------------- */
.contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(22px, 3vw, 40px);
  border-top: 1px solid var(--ink);
  padding-top: 26px;
}

.contact__big {
  font-family: var(--serif);
  font-size: clamp(17px, 1.9vw, 22px);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  max-width: 100%;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.contact__big:hover { border-bottom-color: var(--ink); }

/* ---------- 14b. 聯絡表單（詢問單） ------------------------------------- */
/* 版面照 docs/DESIGN.md：像一張表單／工程圖——細線格框、等寬欄位標籤、
   不做圓角卡片。安全黃只出現在送出鈕與焦點環。 */
.form {
  margin-top: 30px;
  border: 1px solid var(--rule);
  border-top: 2px solid var(--ink);
  background: var(--panel);
  max-width: 44em;
}

.form__row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 0 18px;
  padding: 18px;
  border-bottom: 1px solid var(--rule-soft);
}
.form__row:last-child { border-bottom: 0; }
.form__row--send { background: rgba(14, 28, 25, .025); }

.form__label {
  font-family: var(--mono);
  font-size: 15.5px;
  line-height: 1.6;
  letter-spacing: .04em;
  color: var(--ink);
  font-weight: 500;
  padding-top: 9px;
}

.form__req,
.form__opt {
  display: block;
  font-size: 12.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 2px;
}
.form__req { color: var(--accent-ink); }
.form__opt { color: var(--muted); }

.form__field { min-width: 0; }

.form__in {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 9px 11px;
  width: 100%;
  max-width: 100%;
  transition: border-color .18s;
}
.form__in::placeholder { color: var(--muted); opacity: .75; }
.form__in:hover { border-color: var(--ink-2); }
.form__in:focus,
.form__in:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  box-shadow: 0 0 0 5px var(--focus-glow);
  border-color: var(--ink);
}

.form__in--short { max-width: 9em; }
.form__in--mid   { max-width: 16em; }

.form__ta {
  min-height: 150px;
  resize: vertical;
  display: block;
}

/* 稱呼：短欄位 + 稱謂單選並排 */
.form__inline {
  display: flex;
  align-items: center;
  gap: 10px 16px;
  flex-wrap: wrap;
}

.form__opts {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px 14px;
  flex-wrap: wrap;
}

.form__legend {
  float: left;                       /* legend 不參與 flex，用 float 讓它站在最左 */
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--muted);
  padding: 0 10px 0 0;
  line-height: 2.2;
}

.form__radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  color: var(--ink-2);
  cursor: pointer;
  border: 1px solid var(--rule);
  padding: 6px 11px;
  transition: border-color .18s, color .18s;
}
.form__radio:hover { border-color: var(--ink-2); color: var(--ink); }
.form__radio input { accent-color: var(--ink); margin: 0; }
.form__radio:has(input:checked) { border-color: var(--ink); color: var(--ink); }

.form__hint {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.7;
  margin: 7px 0 0;
}

.form__count {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
  float: right;
  padding-left: 12px;
}
.form__count.is-over { color: var(--accent-ink); font-weight: 500; }

.form__err {
  font-size: 15px;
  line-height: 1.7;
  margin: 8px 0 0;
  padding-left: 11px;
  border-left: 3px solid var(--accent);
  color: var(--ink);
}

.form__in[aria-invalid="true"] { border-color: var(--ink); border-left-width: 3px; }

/* honeypot：畫面上看不到，但不是 display:none（機器人比較容易上鉤） */
.form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn--send {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--accent);
  cursor: pointer;
  font-size: 16.5px;          /* 2026-09-17 使用者：詢問單字放大、按鈕就寫「送出」 */
  letter-spacing: .3em;
  padding: 14px 40px 14px 44px;
}
.btn--send:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--send[disabled] { opacity: .55; cursor: progress; }

.form__note {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.7;
  margin: 12px 0 0;
  max-width: 34em;
}

.form__status {
  margin: 14px 0 0;
  padding: 11px 13px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink);
  background: var(--paper);
  font-size: 14.5px;
  line-height: 1.75;
}
.form__status.is-ok { border-left-color: var(--accent); }

/* ---------- 15. 頁尾 ---------------------------------------------------- */
.site-foot {
  border-top: 1px solid var(--ink);
  margin-top: clamp(32px, 4vw, 56px);
  padding-block: 34px 44px;
  font-size: 14px;
  color: var(--muted);
}

.site-foot__in {
  display: flex;
  justify-content: space-between;
  gap: 18px 40px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.site-foot a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.site-foot a:hover { border-bottom-color: var(--ink); }

.site-foot__nav { display: flex; gap: 18px; flex-wrap: wrap; list-style: none; }

/* ---------- 16. 404 ----------------------------------------------------- */
.nf { padding-block: clamp(60px, 12vw, 140px); }
.nf .num {
  font-size: clamp(64px, 14vw, 140px);
  line-height: 1;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0;
}
.nf h1 { font-size: clamp(24px, 3.4vw, 36px); margin: 18px 0 14px; }

/* ---------- 17. 響應式 -------------------------------------------------- */
@media (max-width: 960px) {
  .hero__in { grid-template-columns: minmax(0, 1fr); }
  .hero__fig { order: 2; }
  .sec__in { grid-template-columns: minmax(0, 1fr); }
  .sec__label { position: static; margin-bottom: 26px; }
  .gallery--wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .site-head { position: static; }
  .site-head__in { min-height: 0; }
  .brand { padding: 12px 0 8px; }
  .nav { gap: 12px 18px; }
  .nav a { font-size: 14.5px; }
  .svc > li,
  .flowsteps > li { grid-template-columns: 44px minmax(0, 1fr); }
  .flowsteps > li { grid-template-areas: "no title" ". when"; }
  .flowsteps__when { grid-column: 2; white-space: normal; padding-top: 8px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .gallery,
  .gallery--wide { grid-template-columns: minmax(0, 1fr); }
  .spec > div { grid-template-columns: 5em minmax(0, 1fr); gap: 8px; }
  .hero h1 em { background-size: 100% 100%; }
  .form__row { grid-template-columns: minmax(0, 1fr); padding: 16px 14px; }
  .form__label { padding-top: 0; margin-bottom: 8px; }
  .form__req, .form__opt { display: inline; margin-left: 8px; }
  .form__row--send .form__label { display: none; }
  .form__in--short { max-width: 7.5em; }
  .form__in--mid { max-width: 100%; }
  .btn--send { width: 100%; text-align: center; }
  .hero__fig { padding: 10px 10px 8px; }        /* 手機上讓流程圖大一點、字才看得清 */
  .hero__fig figcaption { font-size: 10.5px; letter-spacing: .06em; }
}

/* 對照表在窄螢幕改成「一列一張小卡」：欄位標題藏起來，
   每個 <td> 用自己的 data-label 當小標。三、四欄的中文表格硬要橫向捲，
   列高會被看不見的那一欄撐爛，所以這裡不捲、改疊。
   （新增 .cmp 的表格時，每個 <td> 都要寫 data-label，否則手機上看不出那格是什麼。） */
@media (max-width: 760px) {
  .cmp-wrap { overflow-x: visible; border-radius: 0; }
  .cmp,
  .cmp--wide {
    display: block;
    width: 100%;
    min-width: 0;
    border-top: 1px solid var(--ink);
    border-left: 0;
  }
  /* table 變成 block 之後 caption 還是 table-caption，寬度會縮成一個字寬，一定要改 block */
  .cmp caption { display: block; padding: 13px 0; border-bottom: 0; }
  .cmp thead { display: none; }
  .cmp tbody,
  .cmp tfoot { display: block; }
  .cmp tr { display: block; border-bottom: 1px solid var(--rule); padding-bottom: 14px; }
  .cmp tfoot tr { border-bottom: 0; }
  .cmp th,
  .cmp td { display: block; border: 0; padding: 5px 15px; }
  .cmp tbody th,
  .cmp tfoot th {
    width: auto;
    white-space: normal;
    font-size: 16px;
    padding-top: 16px;
    padding-bottom: 4px;
  }
  .cmp td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    color: var(--muted);
    margin-bottom: 1px;
  }
  .cmp tfoot th,
  .cmp tfoot td { background: none; }
  .cmp tfoot tr { background: var(--accent-wash); }
}

@media (max-width: 400px) {
  :root { --pad: 18px; }
}

/* ---------- 18. 降低動態 ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 19. 列印 ---------------------------------------------------- */
@media print {
  .site-head, .filters, .hero__fig { display: none; }
  body { background: #fff; font-size: 12pt; }
  .sec { padding-block: 18pt; }
}

/* ---------- 20. 版型切換（兩套外觀共用的部分） --------------------------
   HTML 裡有些元素只屬於其中一套版型（例如首頁 hero 的兩張流程圖），
   就加 data-theme-only="arc" 或 "grid"，另一套會自動隱藏。
   切換按鈕由 js/site.js 畫進頁首的 <span data-theme-switch> 佔位。
   ---------------------------------------------------------------------- */
[data-theme="arc"]  [data-theme-only="grid"],
[data-theme="grid"] [data-theme-only="arc"] { display: none !important; }

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 7px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .18s, color .18s, background .18s;
}
.theme-switch:hover { border-color: var(--ink); color: var(--ink); }

/* 小圖示：目前版型的形狀（方格＝方、弧線＝圓） */
.theme-switch__dot {
  width: 11px;
  height: 11px;
  flex: none;
  border: 2px solid currentColor;
}
[data-theme="arc"] .theme-switch__dot { border-radius: 999px; }

/* 佔位本身是 .nav 裡的最後一個 <li>，沒有 JS 時是空的、不佔位置 */
.nav > [data-theme-switch] { display: flex; align-items: center; }
