/* ============================================================
   恆生石材 · 網格詳情（獨立詳情頁 Grid Detail Pages）
   Module: 網格卡片對應的獨立詳情頁 + 錨點詳情區
   Version: 20261007a
   ------------------------------------------------------------
   設計目標：參考世界級官網（Apple 產品頁式）——每張網格卡片對應一個
   獨立詳情頁（獨立 URL，利於 Google 抓取與內鏈權重傳遞），詳情為
   真實可見內容（非隱藏彈層，SEO 友善），支援響應式、行動端閱讀、
   列印友好、深色模式兼容。
   ============================================================ */

/* ---- 獨立詳情頁：容器 ---- */
.gd-detail-page { background: #fdfcfa; }
.gd-detail-page .container { width: min(1180px, 92%); margin: 0 auto; }

/* 詳情頁 hero */
.gd-detail-hero {
  padding: 46px 0 34px;
  background:
    linear-gradient(135deg, rgba(201,168,76,.10), rgba(201,168,76,0) 58%),
    linear-gradient(180deg,#fffdf9,#fbf7ef);
  border-bottom: 1px solid rgba(196,168,130,.22);
}
.gd-crumb {
  font-size: .8rem;
  color: #8a8a93;
  margin-bottom: 18px;
}
.gd-crumb a { color: #a8885e; text-decoration: none; }
.gd-crumb a:hover { text-decoration: underline; }
.gd-detail-hero .gd-kicker { display:inline-block; margin-bottom: 10px; }
.gd-detail-hero .gd-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  line-height: 1.28;
  color: #1A1A2E;
  margin: 0 0 14px;
}
.gd-detail-hero .gd-lede {
  max-width: 860px;
  font-size: 1.02rem;
  line-height: 1.85;
  color: #4a4a55;
  margin: 0;
}

/* 詳情頁主體 */
.gd-detail-main { padding: 12px 0 60px; }
.gd-detail-main .gd-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px,1fr));
  border: 1px solid rgba(196,168,130,.26);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 18px rgba(0,0,0,.04);
}
.gd-detail-main .gd-block { padding: 28px 30px; }
.gd-detail-main .gd-block + .gd-block { border-left: 1px solid rgba(196,168,130,.16); }
.gd-detail-main .gd-foot {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 4px 0;
  border-top: 1px solid rgba(196,168,130,.2);
}

@media (max-width: 1024px) {
  .gd-detail-main .gd-block + .gd-block { border-left: 0; border-top: 1px solid rgba(196,168,130,.16); }
}
@media (max-width: 640px) {
  .gd-detail-hero { padding: 30px 0 22px; }
  .gd-detail-main .gd-block { padding: 20px 18px; }
  .gd-detail-main .gd-foot { padding-top: 14px; }
}

/* 深色模式 */
body.dark-mode .gd-detail-page,
body.dark .gd-detail-page { background: #14141a; }
body.dark-mode .gd-detail-hero,
body.dark .gd-detail-hero { background: linear-gradient(180deg,#1c1c22,#17171c); border-bottom-color: rgba(201,168,76,.28); }
body.dark-mode .gd-detail-hero .gd-title,
body.dark .gd-detail-hero .gd-title { color: #F2EDE2; }
body.dark-mode .gd-detail-hero .gd-lede,
body.dark .gd-detail-hero .gd-lede { color: #CFC9BC; }
body.dark-mode .gd-detail-main .gd-body,
body.dark .gd-detail-main .gd-body { background:#1a1a20; border-color: rgba(201,168,76,.3); }
body.dark-mode .gd-detail-main .gd-block p,
body.dark-mode .gd-detail-main .gd-block li,
body.dark .gd-detail-main .gd-block p,
body.dark .gd-detail-main .gd-block li { color:#CFC9BC; }
body.dark-mode .gd-detail-main .gd-block strong,
body.dark .gd-detail-main .gd-block strong { color:#F2EDE2; }

/* ============================================================
   以下為同頁錨點詳情區（保留，兼容並用）
   ============================================================ */

/* ---- 詳情區塊容器 ---- */
.gd-sections {
  margin: 40px 0 8px;
  scroll-margin-top: 90px; /* 錨點定位避開固定頂欄 */
}
.gd-sec {
  border: 1px solid rgba(196,168,130,.28);
  border-radius: 16px;
  background: linear-gradient(180deg,#fffdf9 0%,#fbf7ef 100%);
  box-shadow: 0 2px 18px rgba(0,0,0,.05);
  overflow: hidden;
  transition: box-shadow .3s, border-color .3s;
}
.gd-sec + .gd-sec { margin-top: 22px; }
.gd-sec.is-target {
  border-color: rgba(201,168,76,.75);
  box-shadow: 0 8px 34px rgba(201,168,76,.28);
}

/* 詳情頭部：序號 + 分類 + 標題 */
.gd-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 26px 30px 18px;
  border-bottom: 1px solid rgba(196,168,130,.18);
  background:
    linear-gradient(135deg, rgba(201,168,76,.10), rgba(201,168,76,0) 62%);
  flex-wrap: wrap;
}
.gd-idx {
  flex: 0 0 auto;
  min-width: 52px;
  height: 52px;
  padding: 0 10px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg,#C9A84C,#a8885e);
  box-shadow: 0 4px 14px rgba(201,168,76,.34);
  letter-spacing: .5px;
}
.gd-headtext { flex: 1 1 320px; min-width: 0; }
.gd-kicker {
  display: inline-block;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #a8885e;
  margin-bottom: 6px;
}
.gd-title {
  margin: 0 0 8px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
  line-height: 1.32;
  font-weight: 700;
  color: #1A1A2E;
}
.gd-lede {
  margin: 0;
  font-size: .98rem;
  line-height: 1.78;
  color: #4a4a55;
}
.gd-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  color: #8a6d3b;
  background: #fff;
  border: 1px solid rgba(196,168,130,.5);
  white-space: nowrap;
}

/* 詳情正文網格 */
.gd-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px,1fr));
  gap: 0;
}
.gd-block { padding: 24px 30px; }
.gd-block + .gd-block { border-left: 1px solid rgba(196,168,130,.16); }
.gd-block-h {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  font-size: .95rem;
  font-weight: 700;
  color: #8a6d3b;
  letter-spacing: .3px;
}
.gd-block-h::before {
  content: "";
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg,#C9A84C,#e0c88f);
  flex: 0 0 auto;
}
.gd-block p { margin: 0 0 12px; font-size: .92rem; line-height: 1.82; color: #3f3f48; }
.gd-block p:last-child { margin-bottom: 0; }
.gd-block ul, .gd-block ol { margin: 0; padding-left: 20px; }
.gd-block li { margin-bottom: 9px; font-size: .92rem; line-height: 1.78; color: #3f3f48; }
.gd-block li::marker { color: #C9A84C; }
.gd-block strong { color: #1A1A2E; }

/* 數據格 */
.gd-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(120px,1fr));
  gap: 12px;
  margin-top: 4px;
}
.gd-stat {
  padding: 14px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(196,168,130,.22);
  text-align: center;
}
.gd-stat-num {
  display: block;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.32rem;
  font-weight: 700;
  color: #8a6d3b;
  line-height: 1.2;
}
.gd-stat-label { display: block; margin-top: 4px; font-size: .78rem; color: #666; line-height: 1.5; }

/* 流程步驟 */
.gd-steps { counter-reset: gdstep; margin: 0; padding: 0; list-style: none; }
.gd-steps li {
  counter-increment: gdstep;
  position: relative;
  padding-left: 40px;
  margin-bottom: 15px;
  font-size: .92rem;
  line-height: 1.75;
  color: #3f3f48;
}
.gd-steps li::before {
  content: counter(gdstep, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg,#C9A84C,#a8885e);
}
.gd-steps li:last-child { margin-bottom: 0; }

/* FAQ */
.gd-faq { margin: 0; }
.gd-faq dt {
  font-weight: 700;
  color: #1A1A2E;
  margin-top: 14px;
  font-size: .93rem;
}
.gd-faq dt:first-child { margin-top: 0; }
.gd-faq dd {
  margin: 6px 0 0;
  font-size: .92rem;
  line-height: 1.78;
  color: #4a4a55;
}

/* 詳情底部動作 */
.gd-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 30px 22px;
  border-top: 1px solid rgba(196,168,130,.18);
  background: rgba(255,255,255,.55);
  flex-wrap: wrap;
}
.gd-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.gd-tag {
  font-size: .76rem;
  padding: 5px 12px;
  border-radius: 999px;
  color: #8a6d3b;
  background: #fff;
  border: 1px solid rgba(196,168,130,.34);
}
.gd-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg,#C9A84C,#a8885e);
  box-shadow: 0 6px 18px rgba(201,168,76,.32);
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.gd-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(201,168,76,.42); }

/* 卡片上的詳情角標（注入用） */
.gd-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  color: #8a6d3b;
  background: #fff;
  border: 1px solid rgba(196,168,130,.55);
  cursor: pointer;
  transition: all .22s;
  align-self: flex-start;
}
.gd-card-badge:hover { background: linear-gradient(135deg,#C9A84C,#a8885e); color:#fff; border-color:#C9A84C; }

/* ---- 響應式：平板 ---- */
@media (max-width: 1024px) {
  .gd-block + .gd-block { border-left: 0; border-top: 1px solid rgba(196,168,130,.16); }
}

/* ---- 響應式：手機（底部抽屜式更佳，保留單欄） ---- */
@media (max-width: 640px) {
  .gd-sections { margin: 28px 0 4px; }
  .gd-head { padding: 20px 18px 14px; gap: 12px; }
  .gd-idx { min-width: 44px; height: 44px; font-size: 1rem; border-radius: 12px; }
  .gd-title { font-size: 1.22rem; }
  .gd-lede { font-size: .92rem; }
  .gd-block { padding: 18px; }
  .gd-foot { padding: 14px 18px 18px; }
  .gd-cta { width: 100%; justify-content: center; }
}

/* ---- 列印友好 ---- */
@media print {
  .gd-card-badge, .gd-cta { display: none; }
  .gd-sec { break-inside: avoid; box-shadow: none; }
}

/* ---- 深色模式兼容（跟隨站點 body 變體） ---- */
body.dark-mode .gd-sec,
body.dark .gd-sec {
  background: linear-gradient(180deg,#1c1c22 0%,#17171c 100%);
  border-color: rgba(201,168,76,.3);
}
body.dark-mode .gd-title,
body.dark .gd-title { color: #F2EDE2; }
body.dark-mode .gd-lede,
body.dark .gd-lede,
body.dark-mode .gd-block p,
body.dark .gd-block li,
body.dark-mode .gd-faq dd,
body.dark .gd-block { color: #CFC9BC; }
/* ============================================================
   整卡可點（gd-card-link）+ 返回上一級（gd-back）
   Version: 20261007b
   ============================================================ */

/* ---- 網格卡片整體可點：hover / focus 提示 ---- */
a.gd-card-link {
  display: block;
  position: relative;
  text-decoration: none;
  color: inherit;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease, border-color .3s;
  cursor: pointer;
  outline: none;
}
a.gd-card-link > * { pointer-events: none; } /* 避免內部元素吃掉點擊 */
a.gd-card-link:hover,
a.gd-card-link:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.10), 0 0 0 1px rgba(194,162,94,.32);
  border-color: rgba(194,162,94,.45);
}
a.gd-card-link:focus-visible {
  outline: 2px solid #C9A84C;
  outline-offset: 3px;
}
/* hover 右上角提示徽標（純 CSS，不佔位、不影響原布局） */
a.gd-card-link::after {
  content: "詳情 →";
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  background: linear-gradient(135deg,#C9A84C,#a8885e);
  box-shadow: 0 4px 12px rgba(201,168,76,.34);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
a.gd-card-link:hover::after,
a.gd-card-link:focus-visible::after { opacity: 1; transform: translateY(0); }
body.lang-en a.gd-card-link::after { content: "Details →"; }

/* 深色模式 */
body.dark-mode a.gd-card-link:hover,
body.dark .gd-card-link:hover { box-shadow: 0 12px 32px rgba(0,0,0,.4); }

/* ---- 返回上一級（統一按鈕） ---- */
.gd-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 18px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(196,168,130,.5);
  background: #fff;
  color: #8a6d3b;
  font-size: .84rem;
  font-weight: 700;
  text-decoration: none;
  transition: all .22s;
}
.gd-back::before { content: "←"; font-weight: 700; }
.gd-back:hover {
  background: linear-gradient(135deg,#C9A84C,#a8885e);
  color: #fff;
  border-color: #C9A84C;
  box-shadow: 0 6px 18px rgba(201,168,76,.3);
}
.gd-back:focus-visible { outline: 2px solid #C9A84C; outline-offset: 2px; }
/* 詳情頁內位置 */
.gd-detail-hero .container > .gd-back { margin-bottom: 14px; }
@media (max-width:640px) {
  .gd-back { padding: 9px 14px; font-size: .8rem; margin-bottom: 14px; }
}
