/* 璞永敦安 客變服務專區 — 全站共用樣式
   顏色取自建案 Logo 與電子裱版：墨綠底、香檳金、白字 */

:root {
  --ink: #050a06;          /* 頁首、頁尾底色（與建案 Logo 底色相近） */
  --forest: #13261b;       /* 深綠區塊 */
  --forest-2: #1d3a2a;
  --gold: #c9bc9c;         /* 香檳金：深色底上的強調色 */
  --gold-deep: #7d6c45;    /* 深金：淺色底上的強調文字 */
  --paper: #f6f4ef;        /* 淺色區塊底色 */
  --card: #ffffff;
  --text: #1c241f;
  --muted: #5d665f;
  --line: #e2ddd1;
  --line-green: #06c755;   /* LINE 官方綠 */
  --radius: 14px;
  --max: 1120px;
  --header-h: 73px;        /* 頁首高度（含下框線），sticky 元件的定位基準 */
  --serif: "Noto Serif TC", "Songti TC", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* 錨點跳轉時，不要被 sticky 頁首蓋住 */
[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 頁首 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--ink);
  border-bottom: 1px solid rgba(201, 188, 156, 0.18);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 46px; width: auto; mix-blend-mode: screen; }
.brand-sub {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.2em;
  padding-left: 12px;
  border-left: 1px solid rgba(201, 188, 156, 0.4);
  white-space: nowrap;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: 8px 12px;
  color: #e8e4d8;
  text-decoration: none;
  font-size: 15px;
  letter-spacing: 0.05em;
  border-radius: 8px;
}
.site-nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.site-nav a[aria-current="page"] { color: var(--gold); }
/* 線上選樣：導覽列醒目按鈕 */
.site-nav a.nav-cta {
  margin-left: 6px;
  padding: 7px 16px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold);
  font-weight: 600;
}
.site-nav a.nav-cta:hover,
.site-nav a.nav-cta[aria-current="page"] { background: var(--gold); color: var(--ink); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(201, 188, 156, 0.5);
  color: var(--gold);
  border-radius: 8px;
  padding: 6px 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ink);
    border-bottom: 1px solid rgba(201, 188, 156, 0.18);
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: 8px 20px 16px; }
  .site-nav a { padding: 12px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); border-radius: 0; }
  .site-nav a.nav-cta { margin: 10px 0 4px; padding: 10px 16px; border-radius: 999px; text-align: center; }
}
@media (max-width: 480px) {
  .brand-sub { display: none; }
  .brand img { height: 40px; }
}

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #d8cdb0; }
.btn-ghost { border: 1px solid rgba(255, 255, 255, 0.6); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn-line { background: var(--line-green); color: #fff; }
.btn-line:hover { background: #05b34c; }

/* ---------- 首頁主視覺 ---------- */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: var(--forest) url("../images/hero.jpg") center 40% / cover no-repeat;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 10, 6, 0.15) 0%, rgba(5, 10, 6, 0.55) 55%, rgba(5, 10, 6, 0.9) 100%);
}
.hero .container { position: relative; padding-top: 120px; padding-bottom: 72px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 0.35em;
}
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.25;
  letter-spacing: 0.08em;
}
.hero p.lead {
  max-width: 560px;
  margin: 18px 0 32px;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.88);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- 區塊 ---------- */
.section { padding: 88px 0; }
.section-head { margin-bottom: 40px; }
.section-head .eyebrow { color: var(--gold-deep); }
.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: 0.08em;
}
.section-head p { margin: 12px 0 0; color: var(--muted); }

/* 客變時程：三梯次 */
.batches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.batch {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px 22px;
}
.batch-no {
  font-size: 13px;
  letter-spacing: 0.25em;
  color: var(--gold-deep);
}
.batch-floor {
  margin: 4px 0 2px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.batch-units { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.batch dl { margin: 0; border-top: 1px solid var(--line); }
.batch dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 15px;
}
.batch dl div:last-child { border-bottom: 0; }
.batch dt { color: var(--text); }
.batch dd { margin: 0; color: var(--muted); white-space: nowrap; }
.tbd {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 999px;
  background: #efeadf;
  color: var(--gold-deep);
  font-size: 13px;
}
.note { margin-top: 18px; color: var(--muted); font-size: 14px; }

/* 客變流程 */
.section-dark {
  color: #eeeae0;
  background: var(--forest) url("../images/texture-green.jpg") center / cover no-repeat;
  position: relative;
}
.section-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 6, 0.72);
}
.section-dark > .container { position: relative; }
.section-dark .section-head .eyebrow { color: var(--gold); }
.section-dark .section-head p { color: rgba(238, 234, 224, 0.75); }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  counter-reset: step;
}
.step {
  counter-increment: step;
  border: 1px solid rgba(201, 188, 156, 0.3);
  border-radius: var(--radius);
  padding: 26px 22px;
  background: rgba(5, 10, 6, 0.35);
  display: flex;
  flex-direction: column;
}
.step::before {
  content: "0" counter(step);
  font-family: var(--serif);
  font-size: 28px;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 14px;
}
.step h3 { margin: 0 0 8px; font-size: 19px; font-weight: 600; letter-spacing: 0.05em; color: #fff; }
.step p { margin: 0 0 18px; font-size: 15px; color: rgba(238, 234, 224, 0.8); flex: 1; }
.step a {
  color: var(--gold);
  font-size: 14px;
  text-decoration: none;
  letter-spacing: 0.05em;
}
.step a:hover { text-decoration: underline; }

/* 客變資訊入口 */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--gold-deep); transform: translateY(-2px); }
.card h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: 0.06em; }
.card p { margin: 0 0 16px; color: var(--muted); font-size: 15px; flex: 1; }
.card .more { color: var(--gold-deep); font-size: 14px; letter-spacing: 0.05em; }
/* 線上選樣入口：整列寬、深色底，作為「我要選樣」的主要入口 */
.card-cta { grid-column: 1 / -1; background: var(--forest); border-color: var(--forest); }
.card-cta h3 { color: #fff; }
.card-cta p { color: rgba(255, 255, 255, 0.78); }
.card-cta .more { color: var(--gold); }
.card-cta:hover { border-color: var(--gold); }

/* LINE 區塊 */
.line-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 40px;
}
.line-box img { width: 180px; height: 180px; }
.line-box h2 { margin: 0 0 8px; font-family: var(--serif); font-size: clamp(22px, 5.4vw, 28px); font-weight: 600; letter-spacing: 0.06em; }
.line-box p { margin: 0 0 20px; color: var(--muted); }
.line-id { font-weight: 600; color: var(--text); }
.qr-hint { font-size: 13px; color: var(--muted); text-align: center; margin-top: 6px; }

/* ---------- 內頁（製作中） ---------- */
.page-hero {
  color: #fff;
  background: var(--forest) url("../images/texture-green.jpg") center / cover no-repeat;
  position: relative;
}
.page-hero::before { content: ""; position: absolute; inset: 0; background: rgba(5, 10, 6, 0.7); }
.page-hero .container { position: relative; padding-top: 64px; padding-bottom: 56px; }
.page-hero h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: clamp(28px, 5vw, 42px); letter-spacing: 0.08em; }
.wip {
  background: var(--card);
  border: 1px dashed var(--gold-deep);
  border-radius: var(--radius);
  padding: 28px 30px;
}
.wip h2 { margin: 0 0 12px; font-size: 20px; }
.wip ul { margin: 0; padding-left: 20px; color: var(--muted); }

/* ---------- 內頁左側目錄（全站共用） ----------
   用法：
   <div class="page-body container">
     <nav class="page-toc" aria-label="本頁目錄">
       <p class="page-toc-title">本頁目錄</p>
       <ol><li><a href="#段落代號">段落名稱</a><ol>（可選的第二層）</ol></li></ol>
     </nav>
     <div class="page-content">
       <section class="toc-section" id="段落代號">…</section>
     </div>
   </div>
   桌面：左欄固定在畫面上；手機（≤ 900px）：頁首下方可左右滑的跳轉列。
   目前段落由 main.js 自動加上 .is-active。 */
.page-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding-top: 56px;
  padding-bottom: 88px;
}
.page-toc {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  padding: 4px 0;
}
.page-toc-title {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: 0.25em;
  color: var(--gold-deep);
}
.page-toc ol { list-style: none; margin: 0; padding: 0; }
.page-toc a {
  display: block;
  padding: 7px 0 7px 14px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.page-toc a:hover { color: var(--text); }
.page-toc ol ol a { padding-left: 28px; font-size: 14px; }
.page-toc a.is-active {
  color: var(--gold-deep);
  border-left-color: var(--gold-deep);
  font-weight: 500;
}

.page-content { min-width: 0; }
.toc-section { padding-bottom: 64px; }
.toc-section:last-child { padding-bottom: 0; }
.toc-section + .toc-section { padding-top: 56px; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .page-body { display: block; padding-top: 0; padding-bottom: 64px; }
  .page-toc {
    top: var(--header-h);
    z-index: 40;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0 -20px 40px;
    padding: 10px 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }
  .page-toc::-webkit-scrollbar { display: none; }
  .page-toc-title { display: none; }
  .page-toc ol { display: flex; gap: 8px; width: max-content; }
  .page-toc li { display: contents; }
  .page-toc a,
  .page-toc ol ol a {
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    font-size: 14px;
    white-space: nowrap;
  }
  .page-toc a.is-active {
    color: #fff;
    background: var(--gold-deep);
    border-color: var(--gold-deep);
  }
  /* 手機上跳轉列也是 sticky，錨點要多留出它的高度 */
  .page-content [id] { scroll-margin-top: calc(var(--header-h) + 72px); }
}

/* ---------- 頁尾 ---------- */
.site-footer { background: var(--ink); color: #bdb8ab; font-size: 14px; }
.site-footer .container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 40px;
  align-items: center;
  padding-top: 48px;
  padding-bottom: 48px;
}
.site-footer img { width: 120px; height: auto; }
.footer-info p { margin: 0 0 4px; }
.footer-info strong { color: #eeeae0; font-weight: 500; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--gold); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  padding: 16px 20px;
  font-size: 12px;
  color: #7f7a6e;
}

/* ---------- 點圖放大（img[data-zoom]，由 main.js 產生對話框） ---------- */
img.is-zoomable { cursor: zoom-in; transition: opacity 0.15s ease, box-shadow 0.15s ease; }
img.is-zoomable:hover { opacity: 0.88; box-shadow: 0 0 0 2px var(--gold-deep); }
img.is-zoomable:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.zoom-hint { color: var(--gold-deep); }
body.zoom-open { overflow: hidden; }
.zoom-dialog {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.zoom-dialog::backdrop { background: rgba(5, 10, 6, 0.88); }
.zoom-dialog figure {
  height: 100%;
  margin: 0;
  padding: 64px 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.zoom-dialog img {
  max-width: min(1100px, 100%);
  max-height: calc(100% - 48px);
  object-fit: contain;
  border-radius: 6px;
  background: var(--card);
}
.zoom-dialog figcaption { color: #eeeae0; font-size: 15px; text-align: center; letter-spacing: 0.04em; }
/* ---------- 回到頂端按鈕（全站共用，main.js 產生） ---------- */
.to-top {
  position: fixed;
  right: calc(20px + env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  width: 52px;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold);
  font: inherit;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.to-top span { font-size: 20px; }
.to-top small { font-size: 11px; letter-spacing: 0.08em; margin-top: 2px; }
.to-top.is-shown { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--gold); color: var(--ink); }
.to-top:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
/* 選樣頁底部有送出列，按鈕往上移避免擋住 */
body:has(.sel-bar) .to-top { bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }

.zoom-close {
  position: fixed;
  top: 14px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(5, 10, 6, 0.6);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.zoom-close:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- 響應式 ---------- */
@media (max-width: 900px) {
  .batches { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 64px 0; }
  .line-box { grid-template-columns: 1fr; text-align: center; padding: 32px 24px; }
  .line-box img { margin: 0 auto; }
  .site-footer .container { grid-template-columns: 1fr; text-align: center; gap: 24px; }
  .site-footer img { margin: 0 auto; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .hero { min-height: 72vh; }
  .hero .container { padding-bottom: 48px; }
  .hero-actions .btn { flex: 1 1 100%; }
  /* 手機無法掃描自己螢幕上的 QR code，只保留「加入好友」按鈕 */
  .line-qr { display: none; }
}
