/* ==========================================================================
   永盛徵信社 — 內頁共用版型
   延續首頁的深藏青 + 金銅設計系統，只補內頁需要的元件
   ========================================================================== */

/* ── 頁首主視覺 ──────────────────────────────────────────────── */

.page-hero {
  position: relative;
  background: var(--navy-900);
  color: #fff;
  overflow: hidden;
  padding: clamp(48px, 7vw, 92px) 0 clamp(40px, 6vw, 76px);
}
.page-hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .3;
}
.page-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(13, 27, 42, .94), rgba(13, 27, 42, .74) 55%, rgba(13, 27, 42, .55));
}
.page-hero--plain::after { background: linear-gradient(120deg, var(--navy-900), var(--navy-700)); }
.page-hero-inner { position: relative; z-index: 2; }

.page-hero-title {
  color: #fff;
  font-size: clamp(1.7rem, 4vw, 2.75rem);
  line-height: 1.28;
  letter-spacing: -.025em;
  text-wrap: balance;
  margin-top: 14px;
}
.page-hero-lead {
  margin-top: 16px;
  max-width: 62ch;
  color: #b3c3d3;
  font-size: 1.0313rem;
  line-height: 1.9;
}

/* ── 麵包屑 ──────────────────────────────────────────────────── */

.crumbs { font-size: .8125rem; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.crumbs li { display: flex; align-items: center; gap: 6px; color: #8ea2b6; }
.crumbs li + li::before { content: "/"; color: #55697e; }
.crumbs a { color: #a8bacd; padding: 3px 0; }
.crumbs a:hover { color: var(--gold-400); }
.crumbs [aria-current] { color: #fff; }

/* ── 內文排版（後台編輯器產出的 HTML） ───────────────────────── */

.prose {
  font-size: 1.0313rem;
  line-height: 2.05;
  color: var(--ink-soft);
  overflow-wrap: break-word;
}
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }

.prose p { margin: 0 0 1.35em; }

/* 舊站編輯器在幾乎每個段落都寫死 text-align:center（36/36 服務、1665/1961 新聞），
   長文置中很難讀，一律拉回左對齊；只有純圖片的段落維持置中。 */
.prose :is(p, li) { text-align: start !important; }
.prose p:has(> img:only-child),
.prose p:has(> a:only-child > img:only-child) { text-align: center !important; }
/* 不支援 :has() 的瀏覽器也能讓圖片置中 */
.prose p > img { margin-inline: auto; }

/* 內文寫死的字級與字體一律忽略，交給設計系統統一 */
.prose :is(p, li, span, div)[style*="font-size"] { font-size: inherit !important; }
.prose [style*="font-family"] { font-family: inherit !important; }
/* 內文寫死的顏色若太淺會看不清楚，只保留深色 */
.prose :is(p, li, span)[style*="color"] { color: inherit !important; }
.prose :is(h1, h2, h3, h4) { color: var(--navy-900); line-height: 1.45; margin: 2em 0 .8em; }
.prose h1 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); }
.prose h2 {
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.prose h3 {
  font-size: 1.125rem;
  padding-left: 12px;
  border-left: 3px solid var(--gold-500);
}
.prose h4 { font-size: 1.0313rem; }

.prose a { color: var(--navy-700); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--gold-600); }
.prose strong { color: var(--navy-900); }

.prose :is(ul, ol) { margin: 0 0 1.35em; padding-left: 1.4em; }
.prose ul > li { list-style: disc; margin-bottom: .5em; }
.prose ol > li { list-style: decimal; margin-bottom: .5em; }
.prose li::marker { color: var(--gold-600); }

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.6em auto;
  display: block;
}
.prose figure { margin: 1.6em 0; }
.prose figcaption { font-size: .875rem; color: var(--ink-mute); text-align: center; margin-top: 8px; }

.prose blockquote {
  margin: 1.6em 0;
  padding: 18px 24px;
  background: var(--paper-2);
  border-left: 3px solid var(--gold-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
}

/* 舊站內文常有固定寬度的表格，包一層讓它自己捲 */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: .9375rem;
}
.prose :is(th, td) { border: 1px solid var(--line); padding: 10px 14px; }
.prose th { background: var(--paper-2); font-weight: 700; color: var(--navy-900); }

.prose iframe, .prose video {
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: var(--radius);
  margin: 1.6em 0;
  border: 0;
}

.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

/* ── 內頁主體：左內容右側欄 ──────────────────────────────────── */

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(32px, 4vw, 64px);
  align-items: start;
}
.detail-main { min-width: 0; }

.sidebar { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 20px; }

.side-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.side-card-head {
  padding: 14px 18px;
  background: var(--navy-800);
  color: #fff;
  font-size: .9375rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.side-card-body { padding: 6px 0; }
.side-list li + li { border-top: 1px solid var(--paper-3); }
.side-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 18px;
  font-size: .9375rem;
  color: var(--ink-soft);
  transition: background-color .18s var(--ease), color .18s var(--ease), padding-left .18s var(--ease);
}
.side-list a:hover { background: var(--paper-2); color: var(--navy-900); padding-left: 22px; }
.side-list a[aria-current="page"] {
  background: var(--gold-100);
  color: var(--gold-600);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--gold-500);
}
.side-list .count { font-size: .75rem; color: var(--ink-mute); }

.side-cta {
  padding: 24px 20px;
  background: linear-gradient(150deg, var(--navy-900), var(--navy-700));
  color: #fff;
  border-radius: var(--radius);
  text-align: center;
}
.side-cta p { font-size: .875rem; color: #b6c5d5; margin-bottom: 16px; line-height: 1.8; }
.side-cta .btn { width: 100%; margin-bottom: 8px; }
.side-cta .btn:last-child { margin-bottom: 0; }
.side-cta-tel {
  display: block;
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--gold-400);
  letter-spacing: .02em;
  margin-bottom: 4px;
}

/* ── 文章／內容頁的中繼資訊列 ────────────────────────────────── */

.entry-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  font-size: .875rem;
  color: var(--ink-mute);
}
.entry-meta .chip {
  padding: 3px 12px;
  border-radius: 100px;
  background: var(--navy-100);
  color: var(--navy-700);
  font-size: .75rem;
  font-weight: 600;
}

.entry-title {
  font-size: clamp(1.4rem, 3.2vw, 2.05rem);
  line-height: 1.45;
  letter-spacing: -.02em;
  margin-bottom: 16px;
  text-wrap: balance;
}

.entry-cover {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 28px;
}

/* 上一篇／下一篇 */
.entry-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.entry-nav a {
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.entry-nav a:hover { border-color: var(--gold-500); background: var(--paper-2); }
.entry-nav .dir { display: block; font-size: .75rem; color: var(--gold-600); font-weight: 700; margin-bottom: 6px; }
.entry-nav .t { font-size: .9375rem; color: var(--navy-900); line-height: 1.6; }
.entry-nav .next { text-align: right; }

/* ── 分享 ────────────────────────────────────────────────────── */

.share { display: flex; align-items: center; gap: 10px; margin-top: 32px; flex-wrap: wrap; }
.share span { font-size: .8125rem; color: var(--ink-mute); }
.share a {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-soft);
  transition: all .2s var(--ease);
}
.share a:hover { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }

/* ── 分頁 ────────────────────────────────────────────────────── */

.pager { margin-top: clamp(36px, 5vw, 56px); }
.pager .pagination {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  padding: 0; margin: 0; list-style: none;
}
.pager .page-item .page-link {
  display: grid; place-items: center;
  min-width: 42px; height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink-soft);
  font-size: .9375rem;
  transition: all .18s var(--ease);
}
.pager .page-item .page-link:hover { border-color: var(--gold-500); color: var(--gold-600); }
.pager .page-item.active .page-link {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
  font-weight: 700;
}
.pager .page-item.disabled .page-link { opacity: .4; pointer-events: none; }
.pager .page-item svg { width: 14px; height: 14px; }

/* ── 列表頁通用 ──────────────────────────────────────────────── */

.list-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.list-count { font-size: .875rem; color: var(--ink-mute); }
.list-count strong { color: var(--navy-900); font-size: 1.0625rem; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chips a {
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: .875rem;
  color: var(--ink-soft);
  transition: all .18s var(--ease);
}
.filter-chips a:hover { border-color: var(--gold-500); color: var(--gold-600); }
.filter-chips a[aria-current="page"] {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
  font-weight: 600;
}

.empty-state {
  padding: 64px 20px;
  text-align: center;
  color: var(--ink-mute);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ── 團隊卡片 ────────────────────────────────────────────────── */

.member-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.member {
  text-align: center;
  padding: 28px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.member:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.member img {
  width: 116px; height: 116px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  border: 3px solid var(--paper-3);
}
.member h3 { font-size: 1.0625rem; margin-bottom: 4px; }
.member .role { font-size: .8125rem; color: var(--gold-600); font-weight: 600; }
.member .bio { font-size: .875rem; color: var(--ink-soft); line-height: 1.8; margin-top: 12px; text-align: left; }

/* ── 流程（垂直時間軸，內頁用） ──────────────────────────────── */

.flow { position: relative; padding-left: 38px; }
.flow::before {
  content: "";
  position: absolute; left: 6px; top: 10px; bottom: 10px;
  width: 1px;
  background: linear-gradient(var(--gold-500), var(--line));
}
.flow > li { position: relative; padding-bottom: 38px; }
.flow > li:last-child { padding-bottom: 0; }
.flow > li::before {
  content: "";
  position: absolute; left: -38px; top: 8px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--gold-500);
}
.flow .step-no {
  font-size: .6875rem; font-weight: 700; letter-spacing: .2em;
  color: var(--gold-600); font-variant-numeric: tabular-nums;
}
.flow h3 { font-size: 1.125rem; margin: 6px 0 10px; }

/* ── 聯絡表單 ────────────────────────────────────────────────── */

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.form-grid { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.field label {
  display: block;
  font-size: .875rem;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 7px;
}
.field label .req { color: var(--danger); margin-left: 3px; }
.field :is(input, select, textarea) {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  font-size: .9688rem;
  color: var(--ink);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field :is(input, select, textarea):focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .16);
}
.field textarea { min-height: 150px; resize: vertical; }
.field .hint { font-size: .8125rem; color: var(--ink-mute); margin-top: 6px; }
.field.has-error :is(input, select, textarea) { border-color: var(--danger); }
.field .err { font-size: .8125rem; color: var(--danger); margin-top: 6px; }

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
  font-size: .9375rem;
}
.alert-ok { background: #e8f5ef; color: #1d6a4c; border: 1px solid #b9e0cd; }
.alert-err { background: #fdecea; color: #a03227; border: 1px solid #f3c4bf; }

.contact-info { display: grid; gap: 14px; }
.info-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px 20px;
  background: var(--paper-2);
  border-radius: var(--radius);
}
.info-item .ico {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--navy-800);
  color: var(--gold-400);
}
.info-item .k { font-size: .8125rem; color: var(--ink-mute); margin-bottom: 3px; }
.info-item .v { font-size: 1.0625rem; font-weight: 700; color: var(--navy-900); word-break: break-all; }
.info-item .v a:hover { color: var(--gold-600); }

/* ── 網站導覽 ────────────────────────────────────────────────── */

.sitemap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 40px); }
.sitemap-col h2 {
  font-size: 1.0625rem;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--gold-500);
}
.sitemap-col li { margin-bottom: 9px; }
.sitemap-col a { font-size: .9375rem; color: var(--ink-soft); }
.sitemap-col a:hover { color: var(--gold-600); }

/* ── RWD ─────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .detail-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: 1fr 1fr; display: grid; }
  .member-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  .contact-layout { grid-template-columns: 1fr; }
  .sitemap-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .sidebar { grid-template-columns: 1fr; }
  .member-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .entry-nav { grid-template-columns: 1fr; }
  .entry-nav .next { text-align: left; }
  .sitemap-grid { grid-template-columns: 1fr; }
  .flow { padding-left: 30px; }
  .flow > li::before { left: -30px; }
  .prose { font-size: 1rem; line-height: 1.95; }
}
