/* ==========================================================================
   永盛屏東徵信社 — 設計系統
   概念：卷宗檔案。深炭墨 × 紙感米白 × 硃砂印記，襯線標題 + 索引標籤。
   單檔、無建置流程、無框架。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 設計權杖
   -------------------------------------------------------------------------- */
:root {
  /* 墨 */
  --ink-900: #14161a;
  --ink-800: #1a1c20;
  --ink-700: #24272c;
  --ink-600: #33373e;
  --ink-500: #4a4f57;

  /* 紙 */
  --paper-000: #ffffff;
  --paper-100: #faf8f4;
  --paper-200: #f5f2ec;
  --paper-300: #ebe6dc;
  --paper-400: #ddd6c8;

  /* 硃砂（強調／印記） */
  --seal-600: #8e2d23;
  --seal-500: #b03a2e;
  --seal-400: #c9503f;
  --seal-050: rgba(176, 58, 46, 0.08);

  /* 文字 */
  --text-strong: #14161a;
  --text-body: #3d4148;
  --text-muted: #7b7568;
  --text-invert: #f5f2ec;
  --text-invert-muted: rgba(245, 242, 236, 0.68);

  /* 線 */
  --line-soft: #e2dcd0;
  --line-mid: #cdc5b4;
  --line-dark: rgba(245, 242, 236, 0.18);

  /* 字體 */
  --font-serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --font-sans: "Noto Sans TC", -apple-system, "Segoe UI", "Microsoft JhengHei", sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;

  /* 尺度 */
  --wrap: 1160px;
  --wrap-narrow: 780px;
  --gutter: 24px;

  --radius-sm: 2px;
  --radius-md: 4px;

  --shadow-sm: 0 1px 2px rgba(20, 22, 26, 0.06);
  --shadow-md: 0 6px 24px rgba(20, 22, 26, 0.10);
  --shadow-lg: 0 18px 48px rgba(20, 22, 26, 0.16);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* topbar 40px + header 72px，再留一點呼吸空間，否則錨點會被 sticky 頁首蓋住 */
  scroll-padding-top: 124px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-body);
  background: var(--paper-200);
  /* 極淡的紙紋，靠漸層做，不載圖 */
  background-image:
    radial-gradient(circle at 18% 12%, rgba(176, 58, 46, 0.022) 0, transparent 38%),
    radial-gradient(circle at 82% 78%, rgba(20, 22, 26, 0.020) 0, transparent 42%);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
svg { display: block; }

a { color: var(--seal-500); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--seal-600); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--text-strong);
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 0.6em;
  letter-spacing: 0.01em;
}

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

ul, ol { margin: 0 0 1.1em; padding-left: 1.4em; }

hr {
  border: 0;
  height: 1px;
  background: var(--line-soft);
  margin: 2.4rem 0;
}

::selection { background: var(--seal-500); color: #fff; }

:focus-visible {
  outline: 2px solid var(--seal-500);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 12px 20px;
  background: var(--ink-800);
  color: var(--text-invert);
}
.skip-link:focus { left: 8px; top: 8px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   3. 版面容器
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: var(--wrap-narrow); }

.section { padding-block: clamp(3.5rem, 7vw, 6rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--ink { background: var(--ink-800); color: var(--text-invert); }
.section--ink h1, .section--ink h2, .section--ink h3, .section--ink h4 { color: var(--text-invert); }
.section--paper { background: var(--paper-100); }
.section--rule { border-top: 1px solid var(--line-soft); }

/* 區塊標題：編號 + 細線 + 襯線標題 */
.sec-head { margin-bottom: clamp(2rem, 4vw, 3rem); }

.sec-head__index {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--seal-500);
}
.sec-head__index::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-mid);
}
.section--ink .sec-head__index { color: var(--seal-400); }
.section--ink .sec-head__index::after { background: var(--line-dark); }

.sec-head__title {
  font-size: clamp(1.5rem, 3.2vw, 2.25rem);
  margin-bottom: 0.5rem;
}
.sec-head__lead {
  max-width: 62ch;
  color: var(--text-muted);
  margin: 0;
}
.section--ink .sec-head__lead { color: var(--text-invert-muted); }

/* --------------------------------------------------------------------------
   4. 按鈕
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 26px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.22s var(--ease);
  text-align: center;
}

.btn--seal {
  background: var(--seal-500);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--seal:hover {
  background: var(--seal-600);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--ink {
  background: var(--ink-800);
  color: var(--text-invert);
}
.btn--ink:hover { background: var(--ink-900); color: var(--text-invert); transform: translateY(-1px); }

/* 描邊按鈕的顏色走變數，深底容器只要覆寫變數即可。
   原本是用 .section--ink .btn--ghost 這種祖先選擇器，結果 hero、cta、
   panel--ink 這些同樣是深底但 class 不同的容器全都漏掉，按鈕文字變成
   深色壓在深色底上，等於看不見。 */
.btn--ghost {
  background: transparent;
  border-color: var(--btn-ghost-border, var(--line-mid));
  color: var(--btn-ghost-fg, var(--text-strong));
}
.btn--ghost:hover {
  border-color: var(--btn-ghost-border-hover, var(--ink-800));
  color: var(--btn-ghost-fg, var(--text-strong));
  background: var(--btn-ghost-bg-hover, var(--paper-000));
}

/* 所有深底容器共用這組覆寫 */
.section--ink,
.cta,
.hero,
.page-head,
.panel--ink,
.mobile-nav,
.site-footer {
  --btn-ghost-fg: var(--text-invert);
  --btn-ghost-border: rgba(245, 242, 236, 0.34);
  --btn-ghost-border-hover: rgba(245, 242, 236, 0.62);
  --btn-ghost-bg-hover: rgba(245, 242, 236, 0.10);
}

.btn--sm { min-height: 40px; padding: 8px 18px; font-size: 0.875rem; }
.btn--block { width: 100%; }

/* 文字連結（帶箭頭） */
.link-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}
.link-more::after {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  transition: width 0.22s var(--ease);
}
.link-more:hover::after { width: 28px; }

/* --------------------------------------------------------------------------
   5. 頁首
   -------------------------------------------------------------------------- */
.topbar {
  background: var(--ink-900);
  color: var(--text-invert-muted);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
  flex-wrap: wrap;
}
.topbar__note { margin: 0; }
.topbar__links { display: flex; align-items: center; gap: 6px; }
.topbar__links a {
  color: var(--text-invert-muted);
  padding: 9px 10px;          /* 觸控目標高度 */
  display: inline-flex;
  align-items: center;
}
.topbar__links a:hover { color: var(--text-invert); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(250, 248, 244, 0.94);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line-soft);
  transition: box-shadow 0.25s var(--ease);
}
.site-header.is-stuck { box-shadow: var(--shadow-md); }

/* 頁首用比內容區更寬的容器：品牌 + 8 個中文選單 + 電話 + CTA 在 1160px
   裡塞不下，會擠成一團互相重疊。 */
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  max-width: 1400px;
}

/* 可縮：品牌區在窄螢幕要讓位給選單鈕，否則整條 header 撐出畫面 */
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand__mark { height: 46px; width: auto; flex-shrink: 0; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand__name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand__tag {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.nav { display: flex; align-items: center; gap: 2px; min-width: 0; }
.nav__link {
  position: relative;
  padding: 10px 10px;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-body);
  white-space: nowrap;
}
.nav__link:hover { color: var(--text-strong); }
.nav__link::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  height: 2px;
  background: var(--seal-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.24s var(--ease);
}
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }
.nav__link.is-active { color: var(--text-strong); font-weight: 700; }

.header__cta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.header__phone {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: right;
}
.header__phone-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}
.header__phone-num {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--seal-500);
  letter-spacing: 0.02em;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.nav-toggle__bars { position: relative; width: 20px; height: 2px; background: var(--ink-800); display: block; }
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--ink-800);
  transition: transform 0.24s var(--ease), opacity 0.2s;
}
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* 行動選單
   關閉狀態刻意「不」用 translateX(100%) 推到畫面外：fixed 元素不受 body 的
   overflow-x 約束，會把 documentElement 的 scrollWidth 一起撐大，在每個斷點
   都造成假性橫向溢出。改用淡入 + 短距離位移，動畫還在，但不會超出畫面。 */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--ink-900);
  color: var(--text-invert);
  padding: 20px var(--gutter) 40px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(24px);
  transition: opacity 0.26s var(--ease), transform 0.26s var(--ease), visibility 0s linear 0.26s;
}
.mobile-nav.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition: opacity 0.26s var(--ease), transform 0.26s var(--ease), visibility 0s;
}

.mobile-nav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-dark);
  margin-bottom: 18px;
}
.mobile-nav__close {
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-md);
  color: var(--text-invert);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}
.mobile-nav__list { list-style: none; margin: 0; padding: 0; }
.mobile-nav__list a {
  display: block;
  padding: 14px 4px;
  font-size: 1.05rem;
  color: var(--text-invert);
  border-bottom: 1px solid var(--line-dark);
}
.mobile-nav__sub { list-style: none; margin: 0 0 8px; padding: 0 0 0 14px; }
.mobile-nav__sub a {
  font-size: 0.9rem;
  padding: 11px 4px;
  min-height: 44px;            /* 選單項目要好按 */
  display: flex;
  align-items: center;
  color: var(--text-invert-muted);
}
.mobile-nav__foot { margin-top: 24px; display: grid; gap: 10px; }

/* 行動裝置底部固定聯絡列 */
.mobile-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 55;
  display: none;
  background: var(--ink-900);
  border-top: 1px solid var(--line-dark);
}
.mobile-bar a {
  flex: 1 1 0;
  min-width: 0;                /* 沒有這行，中文字會把三欄一起撐出畫面 */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding-inline: 6px;
  color: var(--text-invert);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}
.mobile-bar a + a { border-left: 1px solid var(--line-dark); }
.mobile-bar a.is-seal { background: var(--seal-500); }

/* --------------------------------------------------------------------------
   6. 麵包屑
   -------------------------------------------------------------------------- */
.crumb {
  background: var(--paper-300);
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.82rem;
}
.crumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 12px 0;
}
.crumb li { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.crumb li + li::before { content: "/"; color: var(--line-mid); }
.crumb a {
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  min-height: 32px;            /* 觸控目標 */
}
.crumb a:hover { color: var(--seal-500); }
.crumb [aria-current] { color: var(--text-strong); font-weight: 500; }

/* --------------------------------------------------------------------------
   7. 頁首橫幅（內頁）
   -------------------------------------------------------------------------- */
.page-head {
  background: var(--ink-800);
  color: var(--text-invert);
  padding-block: clamp(2.75rem, 6vw, 4.5rem);
  position: relative;
  overflow: hidden;
}
.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(176, 58, 46, 0.16) 0%, transparent 46%),
    linear-gradient(0deg, rgba(20, 22, 26, 0.5) 0%, transparent 60%);
  pointer-events: none;
}
.page-head > * { position: relative; }
.page-head__kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--seal-400);
  margin-bottom: 12px;
}
.page-head__title {
  color: var(--text-invert);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  margin-bottom: 0.6rem;
}
.page-head__lead {
  max-width: 64ch;
  color: var(--text-invert-muted);
  margin: 0;
}

/* --------------------------------------------------------------------------
   8. 卷宗卡（服務分類）
   -------------------------------------------------------------------------- */
.dossier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 22px;
}

.dossier {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--paper-000);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.dossier:hover {
  transform: translateY(-4px);
  border-color: var(--line-mid);
  box-shadow: var(--shadow-md);
}

.dossier__media {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
  background: var(--paper-300);
}
.dossier__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.dossier:hover .dossier__media img { transform: scale(1.05); }

/* 索引標籤：卷宗的分頁紙 */
.dossier__tab {
  position: absolute;
  top: 12px;
  left: 0;
  padding: 4px 12px 4px 14px;
  background: var(--seal-500);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  z-index: 1;
}

/* 無圖版式：舊站的分類圖上燒錄了別套服務的名稱，跟分類名對不上，
   所以預設不掛圖。改用透空大編號 + 硃砂頂邊的排版卡，
   後台傳了正確的圖之後會自動切回上面的有圖版式。 */
.dossier--plain { border-top: 3px solid var(--seal-500); }

.dossier__plate {
  position: relative;
  padding: 26px 22px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.dossier__no {
  font-family: var(--font-mono);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-mid);
  transition: -webkit-text-stroke-color 0.25s var(--ease);
}
.dossier:hover .dossier__no { -webkit-text-stroke-color: var(--seal-400); }

.dossier__stamp {
  flex-shrink: 0;
  margin-top: 4px;
  padding: 3px 10px;
  border: 1px solid var(--line-mid);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.dossier--plain .dossier__body { padding-top: 14px; }

.dossier__body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.dossier__title { font-size: 1.12rem; margin-bottom: 0.5rem; }
.dossier__title a { color: var(--text-strong); }
.dossier:hover .dossier__title a { color: var(--seal-500); }
.dossier__excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: hidden;
}
.dossier__foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 整張卡可點 */
.dossier__link::after { content: ""; position: absolute; inset: 0; }

/* --------------------------------------------------------------------------
   9. 卷宗清單（文章列表）
   -------------------------------------------------------------------------- */
.file-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }

.file-list__item {
  position: relative;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.2s var(--ease);
}
.file-list__item:hover { background: var(--paper-000); }

.file-list__link {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  align-items: baseline;
  gap: 18px;
  padding: 18px 14px;
  min-width: 0;
}

.file-list__no {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--seal-500);
}
.file-list__title {
  min-width: 0;
  font-family: var(--font-serif);
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--text-strong);
  line-height: 1.6;
}
.file-list__item:hover .file-list__title { color: var(--seal-500); }
.file-list__meta {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 帶摘要的版本（經驗談／新聞） */
.entry-list { display: grid; gap: 0; border-top: 1px solid var(--line-soft); }

.entry {
  position: relative;
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 26px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line-soft);
  min-width: 0;
}
.entry__aside { min-width: 0; }
.entry__date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.entry__ref {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--seal-500);
}
.entry__body { min-width: 0; }
.entry__title { font-size: 1.16rem; margin-bottom: 0.45rem; }
.entry__title a { color: var(--text-strong); }
.entry:hover .entry__title a { color: var(--seal-500); }
.entry__excerpt {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   10. 內文排版
   -------------------------------------------------------------------------- */
.prose {
  font-size: 1.02rem;
  line-height: 1.95;
  color: var(--text-body);
  min-width: 0;
}
.prose > *:first-child { margin-top: 0; }
.prose h1 { font-size: clamp(1.5rem, 3.4vw, 2rem); margin: 2rem 0 1rem; }
.prose h2 {
  font-size: clamp(1.28rem, 2.6vw, 1.55rem);
  margin: 2.4rem 0 1rem;
  padding-left: 14px;
  border-left: 3px solid var(--seal-500);
}
.prose h3 { font-size: 1.16rem; margin: 1.9rem 0 0.8rem; color: var(--ink-700); }
.prose h4 { font-size: 1.04rem; margin: 1.6rem 0 0.7rem; }
.prose img {
  margin: 1.6rem auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-soft);
}
/* padding-block 不影響行高，但會把可點區撐到 WCAG 的 24px 門檻以上 */
.prose a { text-decoration: underline; text-underline-offset: 3px; padding-block: 3px; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li { margin-bottom: 0.5em; }
.prose strong { color: var(--text-strong); font-weight: 700; }
.prose blockquote {
  margin: 1.6rem 0;
  padding: 16px 22px;
  background: var(--paper-200);
  border-left: 3px solid var(--line-mid);
  color: var(--text-muted);
}
.prose hr { margin: 2rem 0; }

/* 舊站內容常有寬表格，必須能自己捲 */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6rem 0;
  font-size: 0.94rem;
}
.prose th, .prose td {
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}
.prose th { background: var(--paper-300); font-weight: 700; color: var(--text-strong); }
.prose caption { caption-side: top; text-align: left; padding-bottom: 10px; color: var(--text-muted); font-size: 0.88rem; }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
}

/* 收費頁的價目表 */
.price-table {
  width: 100%;
  min-width: 720px;            /* 5 欄中文擠在手機上會不可讀，讓它橫向捲 */
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--paper-000);
}
.price-table caption {
  caption-side: top;
  text-align: left;
  padding: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.86rem;
}
.price-table th,
.price-table td {
  padding: 13px 16px;
  border: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  line-height: 1.7;
}
.price-table thead th {
  background: var(--ink-800);
  color: var(--text-invert);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-color: var(--ink-700);
}
.price-table tbody th {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--text-strong);
  background: var(--paper-100);
  white-space: nowrap;
}
.price-table tbody tr:hover td,
.price-table tbody tr:hover th { background: var(--paper-200); }
.price-table__price {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--seal-500);
  white-space: nowrap;
}

/* 舊站的 .row / .col-* 殘留：避免版面爆開 */
.prose .row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 20px;
  margin: 1.4rem 0;
}
.prose .row > [class*="col-"] { min-width: 0; }
.prose .card { min-width: 0; }

/* --------------------------------------------------------------------------
   11. 文章版面（內文 + 側欄）
   -------------------------------------------------------------------------- */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(30px, 5vw, 60px);
  align-items: start;
}
.article-main { min-width: 0; }

.article-head { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line-soft); }
.article-head__title { font-size: clamp(1.5rem, 3.6vw, 2.1rem); margin-bottom: 0.8rem; }
.article-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.article-head__meta .tag {
  padding: 3px 10px;
  background: var(--seal-050);
  color: var(--seal-500);
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.sidebar { position: sticky; top: 92px; display: grid; gap: 24px; min-width: 0; }

.panel {
  background: var(--paper-000);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 22px;
  min-width: 0;
}
.panel--ink { background: var(--ink-800); border-color: var(--ink-700); color: var(--text-invert); }
.panel__title {
  font-size: 1rem;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.panel--ink .panel__title { color: var(--text-invert); border-color: var(--line-dark); }
.panel__list { list-style: none; margin: 0; padding: 0; }
.panel__list li + li { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-soft); }
.panel__list a {
  color: var(--text-body);
  font-size: 0.9rem;
  line-height: 1.65;
  display: block;
  padding-block: 4px;          /* 觸控目標 */
  min-height: 32px;
}
.panel__list a:hover { color: var(--seal-500); }
.panel__list a.is-active { color: var(--seal-500); font-weight: 700; }

/* 側欄的諮詢卡 */
.consult-card__num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  display: block;
  margin-bottom: 4px;
}
.consult-card p { color: var(--text-invert-muted); font-size: 0.88rem; }

/* --------------------------------------------------------------------------
   12. 流程時間軸
   -------------------------------------------------------------------------- */
.timeline { position: relative; display: grid; gap: 0; }
.timeline::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--line-mid);
}
.timeline__step {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 22px;
  padding: 18px 0;
  min-width: 0;
}
.timeline__dot {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper-200);
  border: 1px solid var(--line-mid);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--seal-500);
}
.timeline__body { min-width: 0; }
.timeline__title { font-size: 1.06rem; margin-bottom: 0.35rem; }
.timeline__text { margin: 0; font-size: 0.93rem; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   13. 問與答手風琴
   -------------------------------------------------------------------------- */
.qa { border-top: 1px solid var(--line-soft); }
.qa__item { border-bottom: 1px solid var(--line-soft); }

.qa__q {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 14px;
  padding: 20px 6px;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.65;
}
.qa__q:hover { color: var(--seal-500); }
.qa__marker { font-family: var(--font-mono); font-size: 0.9rem; color: var(--seal-500); }
.qa__icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 6px;
}
.qa__icon::before,
.qa__icon::after {
  content: "";
  position: absolute;
  background: var(--seal-500);
  transition: transform 0.24s var(--ease);
}
.qa__icon::before { top: 8px; left: 0; width: 18px; height: 2px; }
.qa__icon::after { top: 0; left: 8px; width: 2px; height: 18px; }
.qa__q[aria-expanded="true"] .qa__icon::after { transform: rotate(90deg); }

.qa__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s var(--ease);
}
.qa__a[data-open="true"] { grid-template-rows: 1fr; }
.qa__a > div { overflow: hidden; min-height: 0; }
.qa__a .prose { padding: 0 6px 22px 46px; font-size: 0.96rem; }

/* --------------------------------------------------------------------------
   14. 顧問團隊
   -------------------------------------------------------------------------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 22px;
}
.team-card {
  background: var(--paper-000);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-width: 0;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.team-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.team-card__photo { aspect-ratio: 1 / 1; background: var(--paper-300); }
.team-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.team-card__body { padding: 16px 18px 20px; }
.team-card__name { font-size: 1.04rem; margin-bottom: 4px; }
.team-card__role {
  display: inline-block;
  margin-bottom: 10px;
  padding: 2px 9px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  background: var(--seal-050);
  color: var(--seal-500);
  border-radius: var(--radius-sm);
}
.team-card__expertise { margin: 0; font-size: 0.85rem; color: var(--text-muted); line-height: 1.7; }

/* --------------------------------------------------------------------------
   15. 表單
   -------------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-field { display: grid; gap: 7px; min-width: 0; }
.form-field--full { grid-column: 1 / -1; }

.form-label { font-size: 0.88rem; font-weight: 700; color: var(--text-strong); }
.form-label .req { color: var(--seal-500); margin-left: 3px; }

.form-control {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-body);
  background: var(--paper-000);
  border: 1px solid var(--line-mid);
  border-radius: var(--radius-md);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.form-control:focus {
  outline: none;
  border-color: var(--seal-500);
  box-shadow: 0 0 0 3px var(--seal-050);
}
textarea.form-control { min-height: 140px; resize: vertical; line-height: 1.75; }

.form-error { font-size: 0.82rem; color: var(--seal-500); }

.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--seal-500);
  background: var(--seal-050);
  color: var(--text-strong);
  margin-bottom: 24px;
  font-size: 0.94rem;
}

/* --------------------------------------------------------------------------
   16. 分頁
   -------------------------------------------------------------------------- */
.pager { margin-top: 2.5rem; }
.pager nav > div:first-child { display: none; }   /* Laravel 的行動版簡易分頁 */
.pager .pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center;
}
.pager .page-link {
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0 12px;
  font-size: 0.9rem;
  color: var(--text-body);
  background: var(--paper-000);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
}
.pager .page-link:hover { border-color: var(--ink-800); color: var(--text-strong); }
.pager .active .page-link { background: var(--ink-800); border-color: var(--ink-800); color: var(--text-invert); }
.pager .disabled .page-link { opacity: 0.4; pointer-events: none; }

/* --------------------------------------------------------------------------
   17. 結尾行動呼籲
   -------------------------------------------------------------------------- */
.cta {
  position: relative;
  background: var(--ink-900);
  color: var(--text-invert);
  overflow: hidden;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(176, 58, 46, 0.28) 0, transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgba(176, 58, 46, 0.14) 0, transparent 50%);
}
.cta__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: center;
  padding-block: clamp(2.8rem, 6vw, 4.2rem);
}
.cta__title { color: var(--text-invert); font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 0.6rem; }
.cta__text { color: var(--text-invert-muted); margin: 0; max-width: 56ch; }
.cta__actions { display: grid; gap: 12px; min-width: 220px; }

/* --------------------------------------------------------------------------
   18. 頁尾
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--ink-800);
  color: var(--text-invert-muted);
  font-size: 0.88rem;
  padding-top: clamp(2.8rem, 5vw, 4rem);
}
.site-footer h3 {
  color: var(--text-invert);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-dark);
}
.site-footer a { color: var(--text-invert-muted); }
.site-footer a:hover { color: var(--text-invert); }

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 36px;
  padding-bottom: 36px;
}
.footer-col { min-width: 0; }
.footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.footer-list a { display: inline-flex; align-items: center; min-height: 32px; }

/* logo 是白底深字的點陣圖，brightness(0) invert(1) 會把整張洗成純白方塊。
   跟後台側欄一樣墊一層白底，維持原本的字樣。 */
.footer-brand__mark {
  height: 52px;
  width: auto;
  margin-bottom: 16px;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 6px 10px;
}
.footer-brand p { margin: 0 0 14px; line-height: 1.8; }

.footer-contact { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.footer-contact strong { color: var(--text-invert); display: block; font-size: 0.78rem; letter-spacing: 0.1em; }
.footer-contact a { display: inline-flex; align-items: center; min-height: 32px; }
.footer-contact .num {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--seal-400);
}

.footer-bottom {
  border-top: 1px solid var(--line-dark);
  padding-block: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.8rem;
}
.footer-credits { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.footer-credits a { display: inline-flex; align-items: center; min-height: 32px; }
.footer-credits span + span::before { content: "|"; margin-right: 10px; color: var(--line-dark); }

/* --------------------------------------------------------------------------
   19. 進場動畫（一定要 gate 在 .js 之下）
   -------------------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   20. 響應式
   -------------------------------------------------------------------------- */
/* 1400px 以下先收掉頁首的電話區塊，把寬度讓給選單 */
@media (max-width: 1400px) {
  .header__phone { display: none; }
}

/* 1200px 以下連選單一起收進抽屜 */
@media (max-width: 1200px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}

@media (max-width: 860px) {
  .cta__inner { grid-template-columns: minmax(0, 1fr); }
  .cta__actions { min-width: 0; }
  .entry { grid-template-columns: 96px 1fr; gap: 18px; }
}

@media (max-width: 640px) {
  :root { --gutter: 18px; }

  body { padding-bottom: 56px; }   /* 讓開底部固定聯絡列 */
  .mobile-bar { display: flex; }

  /* 底部固定列已經有電話與 LINE，header 只留選單鈕，把寬度讓給品牌名 */
  .header__cta .btn { display: none; }

  .topbar__inner { justify-content: center; }
  .topbar__note { display: none; }

  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }

  .entry { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 20px 0; }
  .entry__aside { display: flex; align-items: center; gap: 12px; }
  .entry__ref { margin-top: 0; }

  .file-list__link { grid-template-columns: 52px 1fr; gap: 12px; padding: 15px 6px; }
  .file-list__meta { grid-column: 2; }

  .dossier-grid { grid-template-columns: minmax(0, 1fr); }
  .team-grid { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 14px; }

  .qa__q { grid-template-columns: auto 1fr auto; gap: 10px; font-size: 0.96rem; padding: 17px 2px; }
  .qa__a .prose { padding-left: 30px; }

  .prose h2 { font-size: 1.18rem; }
}

@media (max-width: 380px) {
  .brand__mark { height: 34px; }
  .brand__name { font-size: 0.94rem; }
  .brand__tag { display: none; }
}

@media print {
  .site-header, .mobile-bar, .site-footer, .cta, .crumb, .sidebar { display: none !important; }
  body { background: #fff; }
}
