/* 台灣五年千歲文化協會 官方網站 — 靜態原型 v0.11.0 */

/* === 方案 A：宮廷帝王黃 ===
   琥珀金黃   : #D9A036  ← 導覽列、Hero 大面積主視覺
   較深琥珀   : #C18B2C  ← 跑馬燈、hover 狀態
   玄武墨黑   : #1F1A14  ← 農民曆、頁尾深色底；黃底上的主要文字
   硃砂紅     : #A33B2E  ← 重要行動按鈕、消息標籤
   象牙白     : #FDFBF7  ← 頁面底色，取代純白
*/

:root {
  --color-primary:     #D9A036;   /* 琥珀金黃 */
  --color-hover:       #C18B2C;   /* 較深琥珀，hover */
  --color-dark:        #1F1A14;   /* 玄武墨黑 — 金底文字、按鈕文字 */
  --color-accent:      #A33B2E;   /* 硃砂紅 — 重要按鈕、標籤 */
  --color-gold:        #D9A036;
  --color-light-bg:    #F5EDD8;   /* 暖米黃 */
  --color-text:        #1F1A14;   /* 主文字（保持純深色，不跟著棕色走） */
  --color-muted:       #5A4E40;   /* 次要文字 */
  --color-border:      #EBE4D8;   /* 暖米色邊線 */
  --color-page-bg:     #FDFBF7;   /* 象牙白 */
  --color-white:       #FFFFFF;
  --color-placeholder: #BEB0A0;

  --font-zh: "Noto Serif TC", "思源宋體", serif;
  --font-en: Georgia, "Times New Roman", serif;
  --font-ui: "Noto Sans TC", "微軟正黑體", sans-serif;

  --nav-height: 68px;
  --max-width: 1160px;
  --radius: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  color: var(--color-text);
  background: var(--color-page-bg);
  line-height: 1.7;
  font-size: 16px;
}

a { color: inherit; text-decoration: none; }

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

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

/* ---- 佔位符通用樣式 ---- */
.placeholder {
  background: var(--color-placeholder);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  letter-spacing: .5px;
}

/* ============================================================
   導覽列
============================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-primary);
  height: var(--nav-height);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  border-bottom: 2px solid var(--color-hover);
}

.site-nav .container {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 32px;
  /* 導覽列(含最左 logo)避開瀏海/動態島：橫式 env 有值時 logo 內推不被切；
     桌機/iPad env=0 → 回落到一般側距，無影響。內容區(.container)則不加此避讓、更貼邊。 */
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-logo-img {
  height: 50px;
  width: auto;
  border-radius: 6px;
  display: block;
  flex-shrink: 0;
  background: #fff;
  padding: 2px;
}

.nav-logo-text {
  color: var(--color-dark);
  font-family: var(--font-zh);
  font-size: 15px;
  line-height: 1.3;
}

.nav-logo-text small {
  display: block;
  font-size: 11px;
  color: rgba(31,26,20,.65);
  font-family: var(--font-en);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 4px;
  flex: 1;
}

.nav-menu a {
  color: var(--color-dark);
  font-size: 14px;
  padding: 6px 11px;
  border-radius: 4px;
  transition: background .18s, color .18s;
  white-space: nowrap;
}

.nav-menu a:hover {
  background: rgba(31,26,20,.08);
  color: var(--color-accent);
}

/* 「會員登入」收進漢堡用：由 site-nav.js 於手機模式加進 .nav-menu，
   平時(桌機橫向選單/iPad)隱藏，只在手機(≤480)展開的漢堡內顯示(見 ≤480 區塊)。 */
.nav-menu-login { display: none; }

/* 漢堡：桌機隱藏，手機由 @media(max-width:767px) 顯示（見下方）；active 時三線變 X */
.nav-hamburger { display: none; }
.nav-hamburger span { transition: transform .2s, opacity .2s; }
.nav-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

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

.btn-lang {
  font-size: 12px;
  color: var(--color-dark);
  border: 1px solid rgba(31,26,20,.35);
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: border-color .18s;
}

.btn-lang:hover { border-color: var(--color-dark); }

.btn-member {
  font-size: 13px;
  background: transparent;
  color: var(--color-dark);
  font-weight: 600;
  border: 1px solid var(--color-dark);
  padding: 5px 15px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .18s, color .18s;
}
.btn-member:hover { background: var(--color-dark); color: var(--color-primary); }


/* ============================================================
   跑馬燈
============================================================ */
.marquee-bar {
  background: #45300E;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 7px 0;
  overflow: hidden;
}

.marquee-inner {
  display: flex;
  /* 寬度必須等於文字實際長度：不指定的話會被撐成跟外框一樣寬，
     下面 keyframes 的 -50% 就會算到外框寬度而不是文字長度，
     跑馬燈只會滑一小段就彈回原點。 */
  width: max-content;
  gap: 60px;
  /* 補上最後一個 gap，讓「第一組結尾→第二組開頭」的間距和組內一致，
     -50% 才會剛好落在第二組的第一個字上，接縫看不出來。 */
  padding-right: 60px;
  /* 修正寬度後每輪實際位移從 720px 變成 1482px，
     秒數同步加倍才能維持原本的視覺速度。 */
  animation: marquee 56s linear infinite;
  white-space: nowrap;
}

.marquee-inner span {
  font-size: 13px;
  color: #D9A036;
  font-weight: 600;
  letter-spacing: 1px;
}

.marquee-inner span::before {
  content: "📢 ";
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============================================================
   Hero 區
============================================================ */
.hero {
  background: var(--color-primary);
  padding: 80px 0 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 3px solid var(--color-hover);
  color: #1F1A14;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-kicker {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--color-dark);
  text-transform: uppercase;
  margin-bottom: 16px;
  opacity: .7;
}

.hero h1 {
  font-family: var(--font-zh);
  font-size: clamp(28px, 5vw, 48px);
  color: var(--color-dark);
  line-height: 1.25;
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 16px;
  color: var(--color-muted);
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 28px;
  border-radius: 4px;
  transition: opacity .18s;
}

.btn-primary:hover { opacity: .87; }

.btn-ghost {
  border: 2px solid var(--color-dark);
  color: var(--color-dark);
  font-size: 15px;
  padding: 11px 26px;
  border-radius: 4px;
  transition: background .18s;
}

.btn-ghost:hover { background: rgba(31,26,20,.08); }

/* ============================================================
   最新消息卡片
============================================================ */
.section {
  padding: 64px 0;
}

.section-title {
  font-family: var(--font-zh);
  font-size: 24px;
  color: var(--color-text);
  margin-bottom: 8px;
  padding-left: 14px;
  border-left: 4px solid var(--color-primary);
}

.section-title-en {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--color-muted);
  text-transform: uppercase;
  margin-bottom: 36px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.news-card {
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
}

.news-card-img {
  height: 92px;
  background: var(--color-light-bg);
}

/* 消息卡實際照片：完整顯示、不裁切也不變形（contain 保持原比例）。
   直式海報放進橫幅卡片時左右會留白，留白沿用其他卡片的淺底。
   圖只作縮圖用，海報上的文字由卡片下方的標題承載，
   三張卡的圖區高度保持相同以維持整體性。 */
.news-card-img.photo {
  /* 襯底沿用其他消息卡的淺底，三張卡背景一致；紅色只留在海報本身 */
  background: var(--color-light-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* 卡片上只放小縮圖，版面留給文字；要看清楚內容點開燈箱。 */
  padding: 8px;
  box-sizing: border-box;
}
/* 縮圖用 button 包起來，鍵盤 Tab 也能聚焦與開啟 */
.news-thumb-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: zoom-in;
  height: 100%;
  display: flex;
  align-items: center;
  transition: transform .15s;
}
.news-thumb-btn:hover { transform: scale(1.06); }
.news-thumb-btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.news-card-img.photo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}

/* ===== 圖片燈箱（點縮圖放大）===== */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(20,16,10,.88);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#lightbox.show { display: flex; }
#lightbox img {
  /* 手機也看得完整：不超過視窗的 94% 寬、86% 高，等比不裁切 */
  max-width: 94vw;
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
}
#lightbox .lb-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.92);
  color: #1F1A14;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
#lightbox .lb-close:hover { background: #fff; }
#lightbox .lb-close:focus-visible { outline: 3px solid var(--color-gold); outline-offset: 2px; }
#lightbox .lb-hint {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255,255,255,.75);
  font-size: 13px;
}

.news-card-body { padding: 20px; }

.news-tag {
  display: inline-block;
  font-size: 11px;
  background: var(--color-accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.news-card {
  border: 1px solid var(--color-border);
}

.news-card h3 {
  font-family: var(--font-zh);
  font-size: 16px;
  line-height: 1.45;
  margin-bottom: 8px;
  color: var(--color-text);
}

.news-card-date {
  font-size: 12px;
  color: var(--color-muted);
}

/* ============================================================
   農民曆佔位區
============================================================ */
.almanac-section {
  background: var(--color-accent);
  padding: 32px 0 36px;
  color: #fff;
  position: relative;
}

.almanac-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23D9A036' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.almanac-section .container {
  position: relative;
  z-index: 1;
}

/* ── 農民曆 內嵌 Widget ── */
.ae-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.ae-label {
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--color-gold);
  font-weight: 600;
  font-family: var(--font-zh);
}
.ae-more {
  font-size: 12px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-family: var(--font-ui);
  transition: color .18s;
}
.ae-more:hover { color: var(--color-gold); }

/* ── Widget 卡片 ── */
.ae-card {
  display: grid;
  grid-template-columns: 160px 220px 1fr;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(201,168,76,.45);
  min-height: 180px;
}
@media (max-width: 760px) {
  .ae-card { grid-template-columns: 1fr; }
  .ae-mid  { display: none; }
}

/* 左欄：日期 */
.ae-left {
  background: linear-gradient(180deg, #7a1010 0%, #b01818 100%);
  color: #fff;
  text-align: center;
  padding: 18px 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.ae-nt {
  font-size: 11px;
  background: rgba(255,255,255,.2);
  padding: 2px 10px;
  border-radius: 20px;
  font-family: var(--font-ui);
}
.ae-big {
  font-size: 60px;
  font-weight: bold;
  line-height: 1;
  margin: 4px 0;
  font-family: "Noto Serif TC", serif;
}
.ae-dow { font-size: 14px; font-family: var(--font-ui); opacity: .9; }
.ae-lu  { font-size: 12px; font-family: var(--font-ui); margin-top: 5px; line-height: 1.6; opacity: .9; }
.ae-gz  { font-size: 11px; font-family: var(--font-ui); opacity: .7; margin-top: 2px; }

/* 中欄：十二神/黃道/沖煞/四柱 */
.ae-mid {
  background: #fdf8ef;
  border-left: 1px solid rgba(201,168,76,.4);
  border-right: 1px solid rgba(201,168,76,.4);
  padding: 14px 14px 12px;
  color: #3a2a10;
  font-family: var(--font-ui);
}
.ae-jc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.ae-jc-badge {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  line-height: 40px;
  font-family: "Noto Serif TC", serif;
}
.ae-jc-info { font-size: 13px; line-height: 1.6; }
.ae-hd-ji   { color: #a07020; font-weight: 600; }
.ae-hd-xiong{ color: #666; font-weight: 600; }
.ae-cs { font-size: 12px; color: #555; }
.ae-cs small { color: #888; }
.ae-gz-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 8px;
  padding: 8px 6px 6px;
  background: #f5e6c8;
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
}
.ae-gz-strip small { display: block; font-size: 10px; color: #888; margin-bottom: 2px; }
.ae-gz-strip b { color: #5a3a08; }

/* 右欄：宜/忌 */
.ae-right {
  background: #fff;
  padding: 14px 16px 12px;
  overflow: hidden;
}
.ae-yiji {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  height: 100%;
}
.ae-yi, .ae-ji { display: flex; flex-direction: column; }
.ae-yh { font-size: 18px; font-weight: bold; color: #c41e1e; margin-bottom: 5px; font-family: "Noto Serif TC", serif; }
.ae-jh { font-size: 18px; font-weight: bold; color: #1a1a1a; margin-bottom: 5px; font-family: "Noto Serif TC", serif; border-left: 2px solid #ccc; padding-left: 8px; }
.ae-ybody { color: #c41e1e; font-size: 13px; line-height: 1.9; font-family: var(--font-ui); flex: 1; }
.ae-jbody { color: #333; font-size: 13px; line-height: 1.9; font-family: var(--font-ui); flex: 1; }
.ae-supp  { color: #c4741e; font-size: 12px; opacity: .75; }
.ae-shen-row {
  margin-top: 6px;
  font-size: 11px;
  color: #888;
  font-family: var(--font-ui);
  border-top: 1px solid #f0e8d0;
  padding-top: 4px;
  line-height: 1.6;
}

/* ============================================================
   快速服務四宮格
============================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (min-width: 640px) {
  .services-grid { grid-template-columns: repeat(4, 1fr); }
}

/* 服務卡：整張卡就是一張照片，標題與說明小字都已印在圖上（設計稿
   NAS 圖檔(外部)/Gemini_Generated_Image_mjfwzxmjfwzxmjfw.jpeg 裁出）。
   卡內沒有文字撐高度，所以由圖片本身的比例決定卡高，圖完整顯示不裁切。 */
.service-card {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
  border: 2px solid var(--color-primary);
  background: #1c130e;
}

.service-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(217,160,54,.25); }

.service-card-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 764 / 640;
}

/* ============================================================
   關於協會（二欄）
============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}

@media (min-width: 720px) {
  .about-grid { grid-template-columns: 1fr 1fr; }
}

.about-img {
  width: 100%;
  height: 320px;
  background: var(--color-light-bg);
  border-radius: var(--radius);
  overflow: hidden;
}

.about-text h2 {
  font-family: var(--font-zh);
  font-size: 22px;
  color: var(--color-text);
  margin-bottom: 16px;
}

.about-text p {
  font-size: 15px;
  color: var(--color-muted);
  line-height: 1.8;
  margin-bottom: 12px;
}

/* ============================================================
   電子報訂閱
============================================================ */
.newsletter-section {
  background: var(--color-light-bg);
  padding: 56px 0;
  text-align: center;
}

.newsletter-section h2 {
  font-family: var(--font-zh);
  font-size: 22px;
  color: var(--color-text);
  margin-bottom: 8px;
}

.newsletter-section p {
  color: var(--color-muted);
  margin-bottom: 28px;
  font-size: 14px;
}

.newsletter-form {
  display: flex;
  gap: 12px;
  max-width: 440px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.newsletter-form input {
  flex: 1;
  min-width: 200px;
  padding: 11px 16px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 14px;
  font-family: var(--font-ui);
  outline: none;
}

.newsletter-form input:focus {
  border-color: var(--color-primary);
}

.newsletter-form button {
  background: var(--color-primary);
  color: var(--color-dark);
  font-weight: 700;
  border: none;
  padding: 11px 22px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background .18s;
}

.newsletter-form button:hover { background: var(--color-hover); }

/* ============================================================
   頁尾
============================================================ */
.site-footer {
  background: #1F1A14;
  color: #EBE4D8;
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-bottom: 40px;
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

.footer-brand h3 {
  font-family: var(--font-zh);
  color: var(--color-primary);
  font-size: 16px;
  margin-bottom: 10px;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.8;
}

.footer-col h4 {
  color: var(--color-primary);
  font-size: 13px;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col li a {
  font-size: 13px;
  transition: color .18s;
}

.footer-col li a:hover { color: var(--color-primary); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
}

.footer-social {
  display: flex;
  gap: 16px;
}

.footer-social a {
  font-size: 18px;
  transition: opacity .18s;
}

.footer-social a:hover { opacity: .7; }

/* ============================================================
   RWD — 手機／平板直立（漢堡選單）
   斷點 1120px：桌機橫向導覽列整排(logo+英文副標+7選單+會員+EN)攤開需約 1114px，
   原本漢堡只在 ≤767 出現，導致 768~1113px（含所有 iPad 11" 直立=834）卡在
   「不出漢堡、橫向選單又塞不下」的死角，整排往右撐出 280px → 右側露大白帶。
   拉到 1120 讓平板直立改用漢堡；iPad 橫向(1194)與筆電(≥1280)仍走完整橫向選單。
============================================================ */
@media (max-width: 1120px) {
  .nav-menu { display: none; }

  /* 會員＋EN 整組靠右（只在 nav-actions 放 margin-left:auto；
     若漢堡也放 auto，flex 會把剩餘空間平分給兩個 auto，導致寬螢幕(iPad)上
     會員/EN 被推到中央、漢堡孤立在最右）。 */
  .nav-actions { margin-left: auto; }

  .nav-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
  }

  .nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
  }

  /* 點漢堡展開的手機選單：從導覽列下方整寬落下 */
  .nav-menu.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    gap: 0;
    background: var(--color-primary);
    border-bottom: 2px solid var(--color-hover);
    box-shadow: 0 8px 18px rgba(0,0,0,.22);
    padding: 6px 0;
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
  }
  .nav-menu.open li { width: 100%; }
  .nav-menu.open a { display: block; padding: 13px 22px; border-radius: 0; font-size: 15px; }

  /* 手機右側白條修正：導覽列整排(logo+會員+語言+漢堡)固定約 401px，24px 側距下
     在 361~400px 的常見機種(iPhone 12~15=390/393、SE/mini=375)會橫向溢出 11~26px，
     回上一頁重繪時最明顯。改用 16px 手機標準側距，並允許 logo 文字必要時以 … 收尾。 */
  .container { padding-left: 16px; padding-right: 16px; }
  .site-nav .container { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .nav-logo { min-width: 0; flex-shrink: 1; }
  .nav-logo-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
}

/* 手機導覽列：logo 英文長副標最占寬，手機隱藏並整體縮排，
   讓「會員登入」不再被擠到畫面外（原本 390px 時會橫向溢出）。 */
@media (max-width: 480px) {
  .site-nav .container { gap: 10px; }
  .nav-logo { gap: 9px; }
  .nav-logo-img { height: 40px; }
  .nav-logo-text { font-size: 13px; }
  .nav-logo-text small { display: none; }
  .nav-actions { gap: 8px; margin-left: auto; }
  /* 手機模式(≤480)：EN 留外面、會員登入收進漢堡選單(見 site-nav.js 動態加入的
     .nav-menu-login)。EN(span)體積小，導覽列塞得下且 logo 全名完整；iPad(>480) 不受影響，
     兩顆按鈕仍在外。 */
  .btn-member { display: none; }
  .btn-lang { display: inline-flex; }
  .nav-menu.open .nav-menu-login { display: block; border-top: 1px solid rgba(31,26,20,.18); margin-top: 4px; }
  .nav-menu.open .nav-menu-login a { font-weight: 700; }
}

/* 極窄螢幕（≤360px）：會員登入已收進漢堡，EN 保留在外（體積小不溢出），微縮 logo。 */
@media (max-width: 360px) {
  .site-nav .container { gap: 8px; }
  .nav-logo-text { font-size: 13px; }
  .nav-logo-img { height: 38px; }
}

/* 矮螢幕(手機橫式，高 ≤500px)：主視覺上下留白收斂，避免整屏幾乎只剩金底標題；
   只看高度，iPad(高 834/1194) 不受影響。 */
@media (max-height: 500px) {
  .hero { padding: 36px 0 30px; }
  .hero h1 { font-size: 34px; }
}
