/* =========================================================
   靈寶上清宗全球資訊網｜主要樣式
   色彩與字體集中在 :root，修改這裡即可全站套用
   ========================================================= */
:root {
  /* 配色系統：胭脂墨 × 酒紅 × 上清紅 × 香檳金 × 象牙白
     深色區（頁首、主視覺、頁尾）統一用胭脂墨，捲動時頁首不變色 */
  --wine-deep: #2a0b0e;   /* 胭脂墨：頁首、主視覺、頁尾 */
  --wine: #4a1518;        /* 酒紅：標題、主要按鈕 */
  --red: #8e1f22;         /* 上清紅：強調、hover、小標 */
  --gold: #b08a4e;        /* 香檳金：細線、英文小標 */
  --gold-soft: #dcc394;   /* 淡金：深色區上的文字點綴 */
  --ivory: #faf6ef;       /* 象牙白：主要底色 */
  --beige: #f1e8da;       /* 暖米白：交替區塊底色 */
  --gray: #8c7d74;        /* 暖灰：次要文字 */
  --line: rgba(74, 21, 24, .14);
  --line-dark: rgba(220, 195, 148, .16);
  --text: #2e2321;
  --text-soft: #64554f;

  --serif: "Noto Serif TC", "Noto Serif CJK TC", "Songti TC", "PMingLiU", serif;
  --sans: "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", system-ui, sans-serif;
  --latin: "Cormorant Garamond", "Times New Roman", serif;

  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 56px);
  --section: clamp(88px, 11vw, 160px);
  --header-h: 76px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.95;
  letter-spacing: .04em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: .08em; line-height: 1.5; }
p { margin: 0 0 1.2em; }
p:last-child { margin-bottom: 0; }
section[id] { scroll-margin-top: calc(var(--header-h) - 1px); }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.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; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 200; background: var(--wine); color: var(--ivory); padding: 10px 16px; transition: top .2s; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- 共用：小標、標題、按鈕 ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--latin); font-weight: 500; font-size: 14px;
  letter-spacing: .32em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 28px; line-height: 1.4;
}
.eyebrow::before { content: ""; width: 36px; height: 1px; background: currentColor; opacity: .8; }
.eyebrow .num { letter-spacing: .12em; }
.eyebrow, .pillar-index, .topic-num, .notfound .code { font-variant-numeric: lining-nums; }
.section-title { font-size: clamp(26px, 3.3vw, 42px); font-weight: 500; color: var(--wine); }
.lead { color: var(--text-soft); font-size: 16px; }

.btn {
  --bg: var(--wine); --fg: var(--ivory); --bd: var(--wine);
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 52px; padding: 0 30px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--bd);
  font-family: var(--sans); font-size: 15px; letter-spacing: .16em;
  cursor: pointer; transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}
.btn:hover { --bg: var(--red); --bd: var(--red); }
.btn .arrow { width: 22px; height: 1px; background: currentColor; position: relative; transition: width .35s var(--ease); }
.btn .arrow::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
.btn:hover .arrow { width: 30px; }
.btn--light { --bg: var(--ivory); --fg: var(--wine); --bd: var(--ivory); }
.btn--light:hover { --bg: var(--gold-soft); --bd: var(--gold-soft); --fg: var(--wine); }
.btn--ghost-light { --bg: transparent; --fg: var(--ivory); --bd: rgba(248, 244, 236, .45); }
.btn--ghost-light:hover { --bg: rgba(248, 244, 236, .08); --bd: var(--ivory); }
.btn--outline { --bg: transparent; --fg: var(--wine); --bd: var(--wine); }
.btn--outline:hover { --bg: var(--wine); --fg: var(--ivory); }

.text-link {
  display: inline-flex; align-items: center; gap: 14px;
  color: var(--wine); font-size: 15px; letter-spacing: .14em;
  padding: 10px 0; border-bottom: 1px solid var(--gold);
  transition: gap .35s var(--ease), color .35s;
}
.text-link .arrow { width: 22px; height: 1px; background: currentColor; position: relative; }
.text-link .arrow::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); }
.text-link:hover { gap: 22px; color: var(--red); }
.ext-icon { width: 11px; height: 11px; flex: none; opacity: .75; }

/* ---------- 頁首 ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  background: rgba(42, 11, 14, .96); color: var(--ivory);
  border-bottom: 1px solid var(--line-dark);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 14px; line-height: 1.2; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 17px; letter-spacing: .16em; }
.brand-en { font-family: var(--latin); font-size: 11px; letter-spacing: .26em; opacity: .75; margin-top: 3px; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(18px, 2.4vw, 36px); }
.nav a { font-size: 14px; letter-spacing: .14em; position: relative; padding: 6px 0; opacity: .88; transition: opacity .3s; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ease); }
.nav a:hover, .nav a.is-current { opacity: 1; color: var(--gold-soft); }
.nav a:hover::after, .nav a.is-current::after { transform: scaleX(1); }

.menu-toggle { display: none; width: 44px; height: 44px; border: 0; background: transparent; color: inherit; cursor: pointer; position: relative; }
.menu-toggle span { position: absolute; left: 11px; right: 11px; height: 1px; background: currentColor; transition: transform .35s var(--ease), opacity .2s; }
.menu-toggle span:nth-child(1) { top: 16px; }
.menu-toggle span:nth-child(2) { top: 22px; }
.menu-toggle span:nth-child(3) { top: 28px; }
.is-open .menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.is-open .menu-toggle span:nth-child(2) { opacity: 0; }
.is-open .menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
  :root { --header-h: 66px; }
  .menu-toggle { display: block; }
  .nav {
    position: fixed; left: 0; right: 0; top: var(--header-h); bottom: 0;
    background: var(--wine-deep); color: var(--ivory);
    padding: 28px var(--gutter) 48px; overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .35s var(--ease), transform .35s var(--ease), visibility 0s linear .35s;
  }
  .is-open .nav { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav li { border-bottom: 1px solid var(--line-dark); }
  .nav a { display: block; padding: 20px 0; font-family: var(--serif); font-size: 18px; letter-spacing: .18em; }
  .nav a::after { display: none; }
  body.menu-open { overflow: hidden; }
}

/* ---------- SECTION 01 主視覺 ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; color: var(--ivory); background: var(--wine-deep); overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(38, 9, 11, .78) 0%, rgba(38, 9, 11, .35) 55%, rgba(38, 9, 11, .1) 100%), linear-gradient(0deg, rgba(38, 9, 11, .6) 0%, rgba(38, 9, 11, 0) 40%); }
.hero-inner { position: relative; width: 100%; padding-top: calc(var(--header-h) + 64px); padding-bottom: clamp(72px, 12vh, 140px); }
.hero .eyebrow { color: var(--gold-soft); }
.hero-title { font-size: clamp(36px, 6vw, 76px); font-weight: 500; letter-spacing: .12em; line-height: 1.35; margin-bottom: 18px; }
.hero-sub { font-family: var(--serif); font-size: clamp(18px, 2vw, 24px); letter-spacing: .2em; color: var(--gold-soft); margin-bottom: 36px; }
.hero-intro { max-width: 560px; font-size: 15.5px; line-height: 2.1; color: rgba(248, 244, 236, .82); margin-bottom: 48px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.scroll-cue { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; font-family: var(--latin); font-size: 11px; letter-spacing: .4em; color: rgba(248, 244, 236, .6); }
.scroll-cue i { width: 1px; height: 44px; background: linear-gradient(rgba(248, 244, 236, .7), rgba(248, 244, 236, 0)); animation: cue 2.4s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
@media (max-width: 600px) {
  .hero-media img { object-position: 72% 50%; }
  .hero-actions .btn { flex: 1 1 100%; }
  .scroll-cue { display: none; }
}

/* ---------- SECTION 02 認識 ---------- */
.about { padding: var(--section) 0; }
.about-grid { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(40px, 7vw, 112px); align-items: center; }
.about-media { position: relative; }
.about-media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.about-media::before { content: ""; position: absolute; inset: 22px -22px -22px 22px; border: 1px solid var(--gold); opacity: .55; z-index: -1; }
.about-body .section-title { margin-bottom: 40px; }
.about-body .lead { margin-bottom: 44px; }
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-media { max-width: 460px; margin-right: 22px; }
}

/* ---------- SECTION 06 最新消息 ---------- */
.news { padding: var(--section) 0; background: var(--beige); }
.news-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.news-card { background: var(--ivory); padding: 36px 32px; display: flex; flex-direction: column; border-top: 2px solid var(--gold); }
.news-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--gray); letter-spacing: .1em; margin-bottom: 18px; }
.news-cat { color: var(--gold); }
.news-card h3 { font-size: 19px; color: var(--wine); font-weight: 500; margin-bottom: 14px; }
.news-card p { font-size: 14.5px; color: var(--text-soft); flex: 1; }
.news-card .text-link { align-self: flex-start; margin-top: 20px; font-size: 14px; }
.news-empty {
  grid-column: 1 / -1; text-align: center; background: var(--ivory);
  padding: clamp(56px, 8vw, 96px) var(--gutter); position: relative;
}
.news-empty::before { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(184, 155, 94, .45); pointer-events: none; }
.news-empty > svg { width: 44px; height: 44px; margin: 0 auto 28px; display: block; }
.news-empty h3 { font-size: 20px; font-weight: 500; color: var(--wine); margin-bottom: 14px; letter-spacing: .2em; }
.news-empty p { color: var(--text-soft); font-size: 15px; margin-bottom: 0; }
.news-empty .empty-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; margin-top: 32px; }
.news-empty .empty-links a { font-size: 14px; letter-spacing: .12em; color: var(--wine); border-bottom: 1px solid var(--gold); padding-bottom: 4px; display: inline-flex; align-items: center; gap: 8px; }
.news-empty .empty-links a:hover { color: var(--red); }
@media (max-width: 960px) { .news-list { grid-template-columns: 1fr; } }

/* ---------- SECTION 07 頁尾 ---------- */
.site-footer { background: var(--wine-deep); color: rgba(248, 244, 236, .78); padding: clamp(72px, 9vw, 120px) 0 36px; font-size: 14.5px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr; gap: 48px; padding-bottom: 64px; border-bottom: 1px solid rgba(248, 244, 236, .12); }
.footer-brand .brand { color: var(--ivory); margin-bottom: 24px; }
.footer-brand p { font-family: var(--serif); color: rgba(220, 195, 148, .85); letter-spacing: .14em; line-height: 2; max-width: 260px; }
.footer-col h2 { font-family: var(--latin); font-weight: 500; font-size: 13px; letter-spacing: .3em; color: var(--gold-soft); margin-bottom: 22px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.footer-col a { display: inline-flex; align-items: center; gap: 8px; transition: color .3s; }
.footer-col a:hover { color: var(--ivory); }
.contact-list { display: grid; gap: 14px; margin: 0; }
.contact-list div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; }
.contact-list dt { color: rgba(248, 244, 236, .5); letter-spacing: .12em; }
.contact-list dd { margin: 0; }
.contact-list .pending { color: rgba(248, 244, 236, .42); font-size: 13.5px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 28px; font-size: 12.5px; color: rgba(248, 244, 236, .45); letter-spacing: .1em; }
.footer-bottom a:hover { color: var(--ivory); }
@media (max-width: 960px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: 40px; } }

/* ---------- 子頁（隱私權政策、404） ---------- */
.page-hero { background: var(--wine); color: var(--ivory); padding: calc(var(--header-h) + 80px) 0 72px; }
.page-hero h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 500; }
.prose { max-width: 760px; padding: clamp(64px, 8vw, 112px) var(--gutter); margin: 0 auto; }
.prose h2 { font-size: 20px; color: var(--wine); margin: 48px 0 16px; font-weight: 500; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--text-soft); font-size: 15.5px; }
.prose ul { padding-left: 1.3em; }
.prose .updated { font-size: 13.5px; color: var(--gray); margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.notfound { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; background: var(--wine-deep); color: var(--ivory); position: relative; overflow: hidden; }
.notfound .hero-media img { opacity: .55; }
.notfound .wrap { position: relative; padding-top: var(--header-h); }
.notfound .code { font-family: var(--latin); font-size: clamp(64px, 12vw, 140px); line-height: 1; color: var(--gold-soft); letter-spacing: .08em; margin-bottom: 18px; }
.notfound h1 { font-size: clamp(24px, 3vw, 34px); font-weight: 500; margin-bottom: 16px; }
.notfound p { color: rgba(248, 244, 236, .75); margin-bottom: 40px; }

/* ---------- 進場動畫（JS 啟用時才隱藏，確保無 JS 也能看到內容） ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal[data-delay="1"] { transition-delay: .12s; }
.js .reveal[data-delay="2"] { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue i { animation: none; }
}

/* ---------- 細節調整 ---------- */
h1, h2, h3, .news-empty p, .pillar p, .hero-intro { text-wrap: balance; }
@media (max-width: 600px) {
  .eyebrow { font-size: 12px; letter-spacing: .22em; gap: 10px; }
  .eyebrow::before { width: 24px; }
  .hero .eyebrow { padding-right: 120px; }
}
.site-header .text-link { white-space: nowrap; flex: none; }
@media (max-width: 420px) { .site-header .brand-en { letter-spacing: .14em; } }

/* =========================================================
   精簡版入口區塊
   ========================================================= */

/* 區塊標題（置中） */
.sites-head { text-align: center; max-width: 640px; margin: 0 auto clamp(48px, 6vw, 72px); }
.sites-head .eyebrow { justify-content: center; }
.sites-head .eyebrow::after { content: ""; width: 36px; height: 1px; background: currentColor; opacity: .8; }
.sites-head .lead { margin-top: 16px; }

/* 三大官網 */
.sites { padding: var(--section) 0; background: var(--beige); }
.site-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.6vw, 36px); }
.site-card { background: var(--ivory); display: flex; flex-direction: column; transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.site-card:hover { transform: translateY(-6px); box-shadow: 0 28px 56px -32px rgba(74, 21, 24, .45); }
.site-media { overflow: hidden; aspect-ratio: 16 / 9; }
.site-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.site-card:hover .site-media img { transform: scale(1.05); }
.site-body { padding: clamp(28px, 3vw, 40px); display: flex; flex-direction: column; flex: 1; text-align: center; }
.site-stage { font-family: var(--serif); font-size: 14px; letter-spacing: .3em; color: var(--red); margin-bottom: 10px; }
.site-body h3 { font-size: clamp(22px, 2vw, 26px); color: var(--wine); margin-bottom: 14px; }
.site-desc { font-size: 15px; color: var(--text-soft); flex: 1; margin-bottom: 28px; }
.site-go { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; background: var(--wine); color: var(--ivory); font-size: 15px; letter-spacing: .16em; transition: background .35s var(--ease); }
.site-card:hover .site-go { background: var(--red); }
@media (max-width: 960px) { .site-grid { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; } }

/* 認識上清：三個關鍵字 */
.about-body .lead { margin-bottom: 32px; }
.pillars-mini { list-style: none; margin: 0 0 40px; padding: 0; border-top: 1px solid var(--line); }
.pillars-mini li { display: flex; align-items: baseline; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--text-soft); font-size: 15px; }
.pillars-mini strong { font-family: var(--serif); font-weight: 600; font-size: 18px; color: var(--wine); letter-spacing: .2em; flex: none; }

/* 頁尾聯絡 */
.contact-list a { text-decoration: underline; text-decoration-color: rgba(220, 195, 148, .45); text-underline-offset: 5px; }
.contact-list a:hover { color: var(--ivory); text-decoration-color: var(--ivory); }
.contact-note { font-size: 13px; color: rgba(248, 244, 236, .5); margin-top: 16px; }
.site-header .text-link { white-space: nowrap; flex: none; }
.news-meta .news-when { white-space: nowrap; }
.site-desc, .lead { text-wrap: balance; }

/* 教徽 logo */
.brand-mark { width: auto; height: 46px; flex: none; }
.footer-brand .brand-mark { height: 56px; }
@media (max-width: 420px) { .brand-name { font-size: 15.5px; letter-spacing: .1em; } .brand-mark { height: 40px; } }

/* 主視覺 H1：品牌名 + 主標 */
.hero-brand { display: flex; align-items: center; gap: 18px; font-size: clamp(17px, 1.8vw, 22px); font-weight: 500; letter-spacing: .4em; color: var(--gold-soft); margin-bottom: 18px; line-height: 1.4; }
.hero-brand::after { content: ""; width: 48px; height: 1px; background: currentColor; opacity: .7; }
.hero-sub { line-height: 2; letter-spacing: .14em; font-size: clamp(16px, 1.7vw, 20px); margin-bottom: 48px; }
.hero .eyebrow { margin-bottom: 20px; }

/* 頁尾：三大體系簡介 */
.footer-sites li { display: grid; gap: 2px; }
.footer-sites small { font-size: 12.5px; color: rgba(248, 244, 236, .48); letter-spacing: .1em; }
.footer-bottom p { margin: 0; }
.footer-grid { grid-template-columns: 1.3fr 1.1fr .8fr 1.5fr; }
@media (max-width: 1100px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.empty-mark { width: 28px; height: auto; margin: 0 auto 24px; }
html, body { overflow-x: clip; }
