/* ======================================================
   馥靈之鑰 Hour Light - 企業級官網設計系統
   版本：v2.0
   最後更新：2025年1月
   ====================================================== */

/* ==================== 設計變數 ==================== */
:root {
  /* === 字體系統 === */
  --font-serif: "Noto Serif TC", "Times New Roman", serif;
  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  
  /* === 字級系統 === */
  --text-xs: 0.88rem;     /* 14px - 註解、標籤 */
  --text-sm: 0.95rem;     /* 15px - 次要文字 */
  --text-base: 1.06rem;   /* 17px - 內文 */
  --text-lg: 1.15rem;     /* 18.4px - 強調 */
  --text-xl: 1.3rem;      /* 21px - 小標題 */
  --text-2xl: 1.5rem;     /* 24px - 區塊標題 */
  --text-3xl: 1.875rem;   /* 30px - 頁面標題 */
  --text-4xl: 2.25rem;    /* 36px - 主標題 */
  
  /* === 背景色系（黑金宇宙） === */
  --hl-bg: #05030a;
  --hl-bg-soft: #0d0917;
  --hl-bg-card: rgba(12,8,24,0.92);
  
  /* === 金色系（統一為品牌金）=== */
  --hl-gold: #f8dfa5;
  --hl-gold-light: #f8dfa5;
  --hl-gold-deep: #f8dfa5;
  --hl-gold-soft: #f8dfa5;
  
  /* === 奶油色系（浮雕元素） === */
  --hl-cream: #f9f3e8;
  --hl-cream-soft: #efe5d8;
  --hl-cream-deep: #d4c4b0;
  
  /* === 文字色（三色框架：純白 + 奶油金 + 深黑）=== */
  --hl-ink: #ffffff;
  --hl-ink-soft: rgba(255,255,255,.7);
  --hl-ink-muted: rgba(255,255,255,.45);
  
  /* === 點綴色 === */
  --hl-plum: #9c6edb;
  --hl-plum-deep: #7050a0;
  
  /* === 邊框與光暈 === */
  --hl-border: rgba(233,194,125,0.5);
  --hl-border-soft: rgba(233,194,125,0.3);
  --hl-glow: rgba(233,194,125,0.3);
  --hl-glow-strong: rgba(233,194,125,0.6);
  
  /* === 過渡動畫 === */
  --hl-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --hl-ease-out: cubic-bezier(0, 0, 0.2, 1);
  --hl-ease-in: cubic-bezier(0.4, 0, 1, 1);

  /* ─── 金色發光系統（v1.2 統一標準） ─── */
  --hl-glow-gold-text: 0 0 12px rgba(248,223,165,0.4);
  --hl-glow-gold-border: 0 0 8px rgba(248,223,165,0.2);
  --hl-glow-gold-hover: 0 0 40px rgba(248,223,165,0.3), 0 0 12px rgba(248,223,165,0.4);
  --hl-gold-gradient: linear-gradient(135deg, #fbe6c2 0%, #f8dfa5 30%, #ecd098 70%, #fff9ea 100%);

  /* ─── 深色底文字對比度標準 ─── */
  --hl-dark-h1: #f8dfa5;
  --hl-dark-h2: #ffffff;
  --hl-dark-h3: #ecd098;
  --hl-dark-body: rgba(255,255,255,0.92);
  --hl-dark-muted: rgba(255,255,255,0.65);

  /* ─── 淺色底文字對比度標準 ─── */
  --hl-light-h1: #2a1f0e;
  --hl-light-h2: #6b5210;
  --hl-light-h3: #4a3c2a;
  --hl-light-body: #2a2218;
  --hl-light-muted: #6b5a42;
}

/* ==================== Reset 基礎 ==================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 60px; /* 補償 52px sticky topnav，防止 scrollIntoView 被遮住 */
  -webkit-overflow-scrolling: touch;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  /* iOS 動態工具列：先宣告 100vh 老瀏覽器 fallback，再 100dvh 新瀏覽器，最後 100svh 收斂最小視口 */
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--hl-ink);
  line-height: 1.9;
  font-weight: 500;
  letter-spacing: 0.4px;
  background-color: var(--hl-bg);
  background-image:
    radial-gradient(ellipse at top, rgba(233,194,125,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom, rgba(156,110,219,0.05) 0%, transparent 50%);
  background-attachment: fixed;
  /* ── Mobile App Feel ── */
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain; /* 防止下拉刷新彈跳 */
}

/* 有底圖時的 body */
body.with-bg-image {
  background: url('../../background.jpg') center/cover fixed no-repeat;
  background-color: var(--hl-bg);
}

a {
  color: var(--hl-gold);
  text-decoration: none;
  transition: color 0.3s var(--hl-ease);
}

a:hover {
  color: var(--hl-gold-light);
}

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

/* ==================== 文字金色漸層效果 ==================== */
.gold-text,
.hl-gold-text {
  background: linear-gradient(135deg, #fbe6c2 0%, #f8dfa5 30%, #ecd098 70%, #fff9ea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ==================== 容器系統 ==================== */
.hl-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.hl-container-sm {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.hl-container-lg {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==================== 導航列 ==================== */
.hl-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  background: rgba(5,3,10,0.85);
  border-bottom: 1px solid var(--hl-border-soft);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  padding-top: env(safe-area-inset-top, 0px); /* iPhone 瀏海安全區域 */
}

.hl-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.hl-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.hl-nav-brand img {
  height: 36px;
  width: auto;
}

.hl-nav-brand-text {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--hl-gold);
  letter-spacing: 1px;
}

.hl-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hl-nav-link {
  padding: 8px 16px;
  min-height: 48px; /* 觸控目標 48px */
  display: inline-flex;
  align-items: center;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--hl-ink-soft);
  border-radius: 999px;
  transition: all 0.3s var(--hl-ease);
  border: 1px solid transparent;
}

.hl-nav-link:hover {
  color: var(--hl-gold);
  background: rgba(233,194,125,0.1);
  border-color: var(--hl-border-soft);
}

.hl-nav-cta {
  padding: 10px 20px;
  min-height: 48px; /* 觸控目標 48px */
  display: inline-flex;
  align-items: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: #20120a;
  background: linear-gradient(135deg, var(--hl-gold), var(--hl-gold-deep));
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(233,194,125,0.4);
  transition: all 0.3s var(--hl-ease);
}

.hl-nav-cta:hover {
  color: #20120a;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(233,194,125,0.6);
}

/* 漢堡選單（手機版） */
.hl-nav-toggle {
  display: none;
  width: 48px;  /* 觸控目標 48px */
  height: 48px; /* 觸控目標 48px */
  border: 1px solid var(--hl-border-soft);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.hl-nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--hl-gold);
  transition: all 0.3s ease;
}

/* ==================== 卡片系統 ==================== */
.hl-card {
  border-radius: 20px;
  overflow: hidden;
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  background:
    radial-gradient(circle at top left, rgba(233,194,125,0.18), transparent 55%),
    rgba(10,6,24,0.92);
  border: 1px solid var(--hl-border);
  box-shadow:
    0 20px 50px rgba(0,0,0,0.9),
    0 0 30px rgba(233,194,125,0.18),
    inset 0 1px 0 rgba(233,194,125,0.1);
  transition: all 0.4s var(--hl-ease);
}

.hl-card:hover {
  box-shadow:
    0 25px 60px rgba(0,0,0,0.95),
    0 0 50px rgba(233,194,125,0.35),
    inset 0 1px 0 rgba(233,194,125,0.2);
  transform: translateY(-4px);
}

.hl-card-body {
  padding: 32px;
}

.hl-card-lg .hl-card-body {
  padding: 48px;
}

/* 強調卡片（金邊） */
.hl-card-featured {
  border: 2px solid var(--hl-gold);
  position: relative;
}

.hl-card-featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #fbe6c2, var(--hl-gold), var(--hl-gold-deep));
}

/* ==================== 按鈕系統 ==================== */
.hl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  min-height: 48px; /* 觸控目標 48px（Apple HIG + WCAG） */
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s var(--hl-ease);
  -webkit-tap-highlight-color: transparent; /* 移除 iOS 點擊高亮 */
  touch-action: manipulation; /* 避免雙擊縮放延遲 */
}

/* 主要按鈕（金色） */
.hl-btn-primary {
  background: linear-gradient(135deg, var(--hl-gold), var(--hl-gold-deep));
  color: #20120a;
  box-shadow:
    0 10px 26px rgba(0,0,0,0.9),
    0 0 20px rgba(233,194,125,0.65);
}

.hl-btn-primary:hover {
  color: #20120a;
  transform: translateY(-2px);
  box-shadow:
    0 14px 34px rgba(0,0,0,0.95),
    0 0 30px rgba(233,194,125,0.85);
}

/* 次要按鈕（透明金邊） */
.hl-btn-secondary {
  background: transparent;
  color: var(--hl-gold);
  border: 1px solid var(--hl-gold);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.hl-btn-secondary:hover {
  background: rgba(233,194,125,0.15);
  color: var(--hl-gold-light);
  box-shadow: 0 6px 24px rgba(0,0,0,0.6), 0 0 20px rgba(233,194,125,0.3);
}

/* 幽靈按鈕 */
.hl-btn-ghost {
  padding: 10px 24px;
  background: rgba(233,194,125,0.1);
  color: var(--hl-ink-soft);
  border: 1px solid var(--hl-border-soft);
}

.hl-btn-ghost:hover {
  background: rgba(233,194,125,0.2);
  color: var(--hl-gold);
  border-color: var(--hl-border);
}

/* 按鈕尺寸 */
.hl-btn-sm {
  padding: 10px 20px;
  font-size: var(--text-xs);
}

.hl-btn-lg {
  padding: 18px 40px;
  font-size: var(--text-base);
}

/* ==================== 標籤系統 ==================== */
.hl-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 1px;
  background: rgba(233,194,125,0.15);
  color: var(--hl-gold);
  border: 1px solid var(--hl-border-soft);
}

.hl-badge-accent {
  background: linear-gradient(135deg, rgba(156,110,219,0.2), rgba(92,58,128,0.3));
  color: #c9a6ff;
  border-color: rgba(156,110,219,0.4);
}

/* ==================== 區塊標題系統 ==================== */
.hl-section {
  padding: 80px 0;
}

.hl-section-header {
  text-align: center;
  margin-bottom: 48px;
}

.hl-section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--hl-gold);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hl-section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 500;
  color: var(--hl-gold);
  letter-spacing: 2px;
  margin-bottom: 20px;
  line-height: 1.4;
}

.hl-section-desc {
  font-size: var(--text-base);
  color: var(--hl-ink-soft);
  max-width: 640px;
  margin: 0 auto;
  line-height: 2;
}

/* ==================== Grid 系統 ==================== */
.hl-grid {
  display: grid;
  gap: 24px;
}

.hl-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.hl-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.hl-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ==================== Hero 區塊 ==================== */
.hl-hero {
  min-height: 80vh;
  min-height: 80svh; /* iOS safe viewport height，不受地址欄影響 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  position: relative;
}

.hl-hero-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--hl-gold);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hl-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 500;
  letter-spacing: 3px;
  line-height: 1.3;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #fbe6c2 0%, #f8dfa5 30%, #ecd098 70%, #fff9ea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hl-hero-desc {
  font-size: var(--text-lg);
  color: var(--hl-ink-soft);
  max-width: 680px;
  margin: 0 auto 40px;
  line-height: 2;
}

.hl-hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==================== Footer 完整版 ==================== */
/* Footer 樣式統一定義在下方「統一 Footer v3.0」區塊 */

/* ==================== 動畫系統 ==================== */
/* 淡入向上 */
.hl-fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--hl-ease), transform 0.8s var(--hl-ease);
}

.hl-fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 交錯淡入 */
.hl-stagger > *:nth-child(1) { transition-delay: 0.1s; }
.hl-stagger > *:nth-child(2) { transition-delay: 0.2s; }
.hl-stagger > *:nth-child(3) { transition-delay: 0.3s; }
.hl-stagger > *:nth-child(4) { transition-delay: 0.4s; }
.hl-stagger > *:nth-child(5) { transition-delay: 0.5s; }
.hl-stagger > *:nth-child(6) { transition-delay: 0.6s; }

/* 光暈呼吸效果 */
@keyframes hl-glow-pulse {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(233,194,125,0.3);
  }
  50% { 
    box-shadow: 0 0 40px rgba(233,194,125,0.5);
  }
}

.hl-glow-breathing {
  animation: hl-glow-pulse 3s ease-in-out infinite;
}

/* 頁面轉場 */
@keyframes hl-page-enter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hl-page-transition {
  animation: hl-page-enter 0.6s var(--hl-ease-out);
}

/* Keyframe 動畫 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==================== 光線透出效果 ==================== */
.hl-light-leak {
  position: relative;
}

.hl-light-leak::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200%;
  height: 200%;
  background: radial-gradient(
    ellipse at center,
    rgba(233,194,125,0.15) 0%,
    rgba(233,194,125,0.05) 30%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* ==================== 奶油浮雕背景 ==================== */
.hl-cream-accent {
  position: relative;
  background: 
    linear-gradient(rgba(5,3,10,0.85), rgba(5,3,10,0.9)),
    url('../../background.jpg') center/cover;
}

/* ==================== 音樂播放器 ==================== */
.hl-music-toggle {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px)); /* iPhone 底部橫條 */
  right: calc(24px + env(safe-area-inset-right, 0px));
  z-index: 9999;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--hl-border);
  background: rgba(10,6,24,0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--hl-ink-soft);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s var(--hl-ease);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.hl-music-toggle:hover {
  background: rgba(233,194,125,0.2);
  border-color: var(--hl-gold);
  color: var(--hl-gold);
  transform: scale(1.05);
}

.hl-music-toggle.playing {
  border-color: var(--hl-gold);
  color: var(--hl-gold);
  box-shadow: 0 0 20px rgba(233,194,125,0.4);
}

/* ==================== 表格 ==================== */
.hl-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
  border-radius: 12px;
  border: 1px solid var(--hl-border-soft);
}

.hl-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(10,6,24,0.8);
}

.hl-table th,
.hl-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--hl-border-soft);
}

.hl-table th {
  background: rgba(233,194,125,0.1);
  color: var(--hl-gold);
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: 1px;
}

.hl-table tr:last-child td {
  border-bottom: none;
}

.hl-table tr:hover td {
  background: rgba(233,194,125,0.05);
}

/* ==================== 列表 ==================== */
.hl-list {
  list-style: none;
}

.hl-list li {
  padding: 12px 0;
  padding-left: 28px;
  position: relative;
  color: var(--hl-ink-soft);
}

.hl-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--hl-gold);
  font-size: 0.8em;
}

/* ==================== 分隔線 ==================== */
.hl-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hl-border), transparent);
  margin: 40px 0;
}

/* ==================== 工具提示 ==================== */
.hl-tooltip {
  position: relative;
}

.hl-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  background: rgba(10,6,24,0.95);
  border: 1px solid var(--hl-border);
  border-radius: 8px;
  font-size: var(--text-xs);
  color: var(--hl-ink);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 100;
}

.hl-tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  bottom: calc(100% + 8px);
}

/* ==================== 響應式設計 ==================== */
/* 手機版 */
@media (max-width: 480px) {
  .hl-card-body {
    padding: 24px 20px;
  }
  
  .hl-section {
    padding: 60px 0;
  }
  
  .hl-hero {
    min-height: 70vh;
    min-height: 70svh; /* iOS safe viewport height */
    padding: 60px 20px;
  }
  
  .hl-btn {
    padding: 12px 24px;
    width: 100%;
  }
  
  .hl-hero-cta {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
  }
}

/* 平板直式 */
@media (max-width: 768px) {
  .hl-nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    padding: 16px 0;
    border-top: 1px solid var(--hl-border-soft);
    margin-top: 16px;
  }
  
  .hl-nav-links.is-open {
    display: flex;
  }
  
  .hl-nav-toggle {
    display: flex;
  }
  
  .hl-grid-3,
  .hl-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* 平板橫式 */
@media (max-width: 1024px) {
  .hl-container-lg {
    padding: 0 20px;
  }
}

/* ==================== 工具類 ==================== */
.hl-text-center { text-align: center; }
.hl-text-left { text-align: left; }
.hl-text-right { text-align: right; }

.hl-mb-0 { margin-bottom: 0; }
.hl-mb-1 { margin-bottom: 8px; }
.hl-mb-2 { margin-bottom: 16px; }
.hl-mb-3 { margin-bottom: 24px; }
.hl-mb-4 { margin-bottom: 32px; }
.hl-mb-5 { margin-bottom: 48px; }

.hl-mt-0 { margin-top: 0; }
.hl-mt-1 { margin-top: 8px; }
.hl-mt-2 { margin-top: 16px; }
.hl-mt-3 { margin-top: 24px; }
.hl-mt-4 { margin-top: 32px; }
.hl-mt-5 { margin-top: 48px; }

.hl-hidden { display: none !important; }
.hl-visible { visibility: visible; }
.hl-invisible { visibility: hidden; }

/* ==================== Scroll 錨點偏移 ==================== */
:target {
  scroll-margin-top: 100px;
}

/* JS scrollIntoView 目標元素偏移補正（52px topnav + 20px 緩衝）*/
#resultArea, #result-area, #result, #resultSection, #result-section,
#quizResult, #matchResult, #profileSection, #layerSection, #ra,
#body-awareness-section, #step1, #step2, #step3, #step4,
#step-2, #step-4, #step-5, #step-6,
#toolList, #ycResult, #inspirationResult, #quiz-result {
  scroll-margin-top: 72px;
}

/* ==================== 選取文字樣式 ==================== */
::selection {
  background: rgba(233,194,125,0.3);
  color: var(--hl-ink);
}

::-moz-selection {
  background: rgba(233,194,125,0.3);
  color: var(--hl-ink);
}

/* ==================== 自訂滾動條 ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--hl-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--hl-gold-soft);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--hl-gold);
}

/* ==================== 延伸探索區塊 ==================== */
/* 內部連結推薦區塊 - SEO 優化用 */
.hl-explore {
  padding: 60px 24px;
  margin-top: 40px;
  border-top: 1px solid var(--hl-border-soft);
  background: linear-gradient(180deg, transparent 0%, rgba(233,194,125,0.03) 100%);
}

.hl-explore-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.hl-explore-title {
  text-align: center;
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  color: var(--hl-gold);
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.hl-explore-subtitle {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--hl-ink-muted);
  margin-bottom: 32px;
}

.hl-explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.hl-explore-card {
  display: block;
  padding: 24px;
  min-height: 48px; /* 觸控目標 48px */
  border-radius: 16px;
  background: rgba(10,6,24,0.6);
  border: 1px solid var(--hl-border-soft);
  text-decoration: none;
  transition: all 0.3s var(--hl-ease);
}

.hl-explore-card:hover {
  border-color: var(--hl-border);
  background: rgba(233,194,125,0.08);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

.hl-explore-card-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.hl-explore-card-title {
  font-family: var(--font-serif);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--hl-ink);
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.hl-explore-card:hover .hl-explore-card-title {
  color: var(--hl-gold);
}

.hl-explore-card-desc {
  font-size: var(--text-sm);
  color: var(--hl-ink-muted);
  line-height: 1.6;
}

/* 奶油底色版本 - 用於淺色背景頁面 */
.hl-explore.hl-explore-cream {
  background: linear-gradient(180deg, transparent 0%, rgba(201,162,39,0.05) 100%);
  border-top-color: rgba(201,162,39,0.15);
}

.hl-explore-cream .hl-explore-card {
  background: rgba(255,255,255,0.6);
  border-color: rgba(201,162,39,0.2);
}

.hl-explore-cream .hl-explore-card:hover {
  background: rgba(255,255,255,0.9);
  border-color: rgba(201,162,39,0.4);
}

.hl-explore-cream .hl-explore-card-title {
  color: #2D2A26;
}

.hl-explore-cream .hl-explore-card:hover .hl-explore-card-title {
  color: #A68B1F;
}

.hl-explore-cream .hl-explore-card-desc {
  color: #7A756D;
}

@media (max-width: 480px) {
  .hl-explore {
    padding: 40px 16px;
  }
  
  .hl-explore-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .hl-explore-card {
    padding: 20px;
  }
}

/* ==================== 簡潔版 Footer v3.0（精緻化）==================== */
/* ==================== 統一 Footer v3.0 ==================== */
.hl-footer {
  background: linear-gradient(180deg, transparent 0%, rgba(5,3,10,0.9) 100%);
  border-top: 1px solid rgba(233,194,125,0.1);
  padding: 28px 24px 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom, 0px)); /* iPhone 底部橫條安全區域 */
  margin-top: 40px;
}

.hl-footer-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

/* 品牌區 */
.hl-footer-brand {
  margin-bottom: 8px;
}

.hl-footer-logo {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, var(--hl-gold-light) 0%, var(--hl-gold) 50%, var(--hl-gold-deep) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2px;
}

.hl-footer-tagline {
  font-size: 0.82rem;
  color: var(--hl-ink-soft);
  letter-spacing: 0.05em;
}

/* 隱藏舊的創辦人區塊 */
.hl-footer-founder { display: none; }

/* 快速連結 */
.hl-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 12px 0 16px;
}

.hl-footer-links a {
  font-size: 0.82rem;
  color: var(--hl-ink-soft);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.25s ease;
  position: relative;
}

.hl-footer-links a:hover {
  color: var(--hl-gold);
}

.hl-footer-links a:not(:last-child)::after {
  content: "·";
  position: absolute;
  right: -12px;
  color: rgba(233,194,125,0.25);
  pointer-events: none;
}

/* 法律聲明 - 可收合按鈕 */
.hl-footer-legal-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  margin-bottom: 14px;
  background: rgba(233,194,125,0.06);
  border: 1px solid rgba(233,194,125,0.15);
  border-radius: 20px;
  color: var(--hl-ink-soft);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.hl-footer-legal-toggle:hover {
  background: rgba(233,194,125,0.12);
  border-color: rgba(233,194,125,0.3);
  color: var(--hl-gold);
}

.hl-footer-legal-toggle .arrow {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.hl-footer-legal-toggle.active .arrow {
  transform: rotate(180deg);
}

/* 法律聲明 - 收合內容 */
.hl-footer-legal-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

.hl-footer-legal-content.active {
  max-height: 500px;
  opacity: 1;
  margin-bottom: 14px;
}

.hl-legal-section {
  text-align: left;
  padding: 10px 16px;
  margin-bottom: 6px;
  background: rgba(233,194,125,0.04);
  border-radius: 8px;
}

.hl-legal-title {
  font-size: 0.8rem;
  color: var(--hl-gold);
  font-weight: 600;
  margin-bottom: 4px;
}

.hl-legal-text {
  font-size: 0.75rem;
  color: var(--hl-ink-muted);
  line-height: 1.7;
}

.hl-legal-text strong {
  color: var(--hl-ink-soft);
}

/* 隱藏舊版法律聲明區塊 */
.hl-footer-disclaimer,
.hl-footer-legal,
.hl-footer-legal-grid,
.hl-footer-disclaimer-title,
.hl-footer-disclaimer-content,
.hl-footer-legal-item,
.hl-footer-trademark {
  display: none !important;
}

/* 版權聲明 */
.hl-footer-copyright {
  padding-top: 14px;
  border-top: 1px solid rgba(233,194,125,0.08);
  font-size: 0.72rem;
  color: var(--hl-ink-muted);
  text-align: center;
  line-height: 1.6;
}

.hl-footer-copyright-brand {
  color: var(--hl-ink-soft);
  font-weight: 600;
}

/* Footer RWD */
@media (max-width: 768px) {
  .hl-footer {
    padding: 24px 16px 18px;
    margin-top: 32px;
  }
  .hl-footer-links {
    gap: 6px 12px;
  }
  .hl-footer-links a {
    font-size: 0.8rem;
  }
  .hl-footer-links a::after {
    display: none;
  }
  .hl-legal-section {
    padding: 8px 12px;
  }
}

/* ==================== 淺色背景 Footer（米色系頁面用）==================== */
.hl-footer-cream {
  background: linear-gradient(180deg, #faf6f0 0%, #f5f0e8 100%);
  border-top: 1px solid #e8dfd3;
}

.hl-footer-cream .hl-footer-brand {
  color: #4a3728;
}

.hl-footer-cream .hl-footer-founder {
  color: #8b7d6b;
}

.hl-footer-cream .hl-footer-links a {
  color: #5c4a3a;
}

.hl-footer-cream .hl-footer-links a:hover {
  color: #b8860b;
  background: rgba(212,160,23,0.1);
}

.hl-footer-cream .hl-footer-disclaimer,
.hl-footer-cream .hl-footer-legal {
  background: #fff;
  border-color: #e8dfd3;
}

.hl-footer-cream .hl-footer-disclaimer:hover {
  background: rgba(212,160,23,0.05);
  border-color: #d4a017;
}

.hl-footer-cream .hl-footer-disclaimer-title,
.hl-footer-cream .hl-footer-disclaimer-content p,
.hl-footer-cream .hl-footer-legal-item {
  color: #8b7d6b;
}

.hl-footer-cream .hl-footer-legal-item strong {
  color: #5c4a3a;
}

.hl-footer-cream .hl-footer-copyright {
  border-top-color: #e8dfd3;
  color: #8b7d6b;
}

.hl-footer-cream .hl-footer-copyright-brand {
  color: #b8860b;
}

/* =====================================================
   升級模組補充樣式 v3.0  2026-03
   ===================================================== */

/* 計數器動畫（社會證明數字浮現） */
@keyframes hl-count-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hl-proof-num.animated {
  animation: hl-count-up 0.6s var(--hl-ease-out) both;
}

/* 卡片 hover shimmer 效果增強 */
.item-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(233,194,125,0.04) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.item-card:hover::after { opacity: 1; }

/* 全站頂部導覽列 */
.hl-home-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  padding-top: env(safe-area-inset-top, 0px); /* iPhone 瀏海安全區域 */
  padding-left: max(32px, env(safe-area-inset-left, 0px));
  padding-right: max(32px, env(safe-area-inset-right, 0px));
  background: rgba(14,12,20,0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(212,168,83,0.18);
}
.hl-nav-left, .hl-nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.hl-home-nav-brand {
  font-family: var(--font-serif, 'Noto Serif TC', serif);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--hl-gold, #d4a853);
  text-decoration: none;
}
.hl-home-nav-link {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  letter-spacing: 0.08em;
  transition: color 0.2s;
}
.hl-home-nav-link:hover { color: var(--hl-gold, #d4a853); }
.hl-home-nav-cta {
  display: inline-block;
  padding: 7px 20px;
  background: linear-gradient(135deg, #d4a853, #a07830);
  color: #1a0e00;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 1.5px;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.25s;
  box-shadow: 0 4px 14px rgba(212,168,83,0.3);
}
.hl-home-nav-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(212,168,83,0.45); }
@media(max-width:680px) {
  .hl-home-nav { padding: 0 18px; }
  .hl-nav-left .hl-home-nav-link { display: none; }
  .hl-home-nav-brand { font-size: 0.88rem; }
}

/* nav 捲動後加深背景 */
.hl-home-nav.scrolled {
  background: rgba(5,3,10,0.95);
  border-bottom-color: rgba(233,194,125,0.2);
}

/* ── Footer LOGO 圖標（全域統一）── */
.hl-logo-icon{
  height:1.15em;
  width:1.15em;
  border-radius:50%;
  object-fit:cover;
  vertical-align:middle;
  margin-right:4px;
  display:inline-block;
  position:relative;
  top:-0.08em;
}

/* ══════════════════════════════════════════
   全域文字可讀性系統 v3.0（2026-03-14）
   原則：不強制粗體，讓各頁面自己決定
   ══════════════════════════════════════════ */

/* ── 一、只有 strong/b/th 加粗 ── */
strong, b, th {
  font-weight: 700;
}

/* ── 二、文字陰影已全域移除（2026-03-15）── */
/* 金色光暈效果保留在各頁面 inline style 中 */

/* ── 三、按鈕文字 ── */

/* ── 四、opacity 不做全域強制 ── */


/* ═══════════════════════════════════════════════════════════
   全站色彩強制標準 v1.2（2026/3/21）
   只針對共用元件，不碰頁面特有的 inline style
   ═══════════════════════════════════════════════════════════ */

/* --- 金色發光標題（所有頁面的 section 標題） --- */
.rb-h2, .rb-eyebrow,
.hub-section-title,
.result-section-title,
.hour-bridge-label {
  text-shadow: var(--hl-glow-gold-text, 0 0 12px rgba(248,223,165,0.4));
}

/* --- 深色底上的區塊標題統一金色 --- */
body .hl-footer-tagline { color: rgba(255,255,255,0.65); }
body .hl-footer-logo { color: var(--hl-gold, #f8dfa5); }
body .hl-footer-copyright { color: rgba(255,255,255,0.45); }

/* --- 連結 hover 統一金色發光 --- */
body a:hover { text-shadow: 0 0 8px rgba(248,223,165,0.2); }

/* --- 全站按鈕統一金色發光感 --- */
.rb-btn-primary,
.btn-next:not(:disabled),
.hour-bridge-cta,
.hub-export-btn {
  box-shadow: 0 0 20px rgba(248,223,165,0.2);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}
.rb-btn-primary:hover,
.btn-next:not(:disabled):hover,
.hour-bridge-cta:hover,
.hub-export-btn:hover {
  box-shadow: 0 0 32px rgba(248,223,165,0.3), 0 0 8px rgba(248,223,165,0.4);
  transform: translateY(-1px);
}

/* --- 分隔線統一金色漸層 --- */
.rb-rule, .hl-sign-divider {
  background: linear-gradient(90deg, transparent, rgba(248,223,165,0.4), transparent);
}

/* --- 卡片統一金色邊框發光 --- */
.rb-tool-card:hover,
.hub-card:hover,
.more-card:hover {
  box-shadow: 0 0 20px rgba(248,223,165,0.15);
  border-color: rgba(248,223,165,0.35);
}

/* --- 社群圖標列 hover 發光 --- */
.hl-footer-social a:hover {
  border-color: rgba(248,223,165,0.5) !important;
  box-shadow: 0 0 12px rgba(248,223,165,0.2) !important;
}

/* ═══════════════════════════════════════════════════════════
   iOS 手機全面優化（2026/4/3）
   ═══════════════════════════════════════════════════════════ */

/* --- iOS 防縮放：input/select/textarea 字級必須 ≥16px（全螢幕寬度皆適用） --- */
input, select, textarea {
  font-size: 16px !important;
}

/* --- App-like 觸控體驗 --- */
body {
  -webkit-tap-highlight-color: transparent;
}
* {
  -webkit-touch-callout: none;
}
input, textarea, [contenteditable] {
  -webkit-touch-callout: default;
  user-select: text;
  -webkit-user-select: text;
}

/* --- 按鈕按下回饋感 --- */
button:active, .btn:active, [onclick]:active,
a.rb-btn-primary:active, a.rb-btn-ghost:active,
.btn-next:active, .btn-prev:active,
.share-btn:active, .quiz-opt:active, .likert-opt:active,
.hub-card:active, .hl-bn-item:active {
  transform: scale(0.97);
  transition: transform 0.08s ease;
}

/* --- 手機觸控目標最低 48px --- */
@media (max-width: 767px) {
  button, a.rb-btn-primary, a.rb-btn-ghost,
  .btn-next, .btn-prev, .share-btn,
  .likert-opt, .hub-card {
    min-height: 48px;
    touch-action: manipulation;
  }

  input, select, textarea {
    min-height: 48px;
  }
}

/* --- 手機防水平溢出 --- */
@media (max-width: 480px) {
  img { max-width: 100%; height: auto; }
  table { width: 100%; overflow-x: auto; display: block; }
  pre, code { overflow-x: auto; max-width: 100%; }
}

/* --- 深色主題 select option 背景（iOS/Android 預設白底修正） --- */
select option {
  background: #1a1428;
  color: #fff;
}

/* --- 深色主題 placeholder 可見性（WCAG AA 修 2026/04/17）--- */
::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

/* ═══════════════════════════════════════════════ */
/* Modal scroll-lock · iOS Safari 彈窗時鎖背景捲軸   */
/* 用法：JS 開彈窗時 document.body.classList.add('hl-modal-open') */
/* ═══════════════════════════════════════════════ */
body.hl-modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  /* 保存目前 scrollY 位置，JS 層需同步 inline style: top: -${scrollY}px */
}
html.hl-modal-open {
  overflow: hidden;
  overscroll-behavior: contain;
}
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
  color: rgba(255, 255, 255, 0.85);
}

/* --- 玻璃透明感（深底色區塊） --- */
.hl-sign-section,
.rb-stats-bar {
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

/* ═══ 測驗選項手機修復 ═══ */
.quiz-option {
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}
.quiz-option > span:last-child {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}
@media (max-width: 420px) {
  .quiz-card { padding: 24px 16px; }
  .quiz-option { padding: 12px 14px; gap: 10px; font-size: 0.88rem; line-height: 1.7; }
  .quiz-option > span:first-child { font-size: 0.82rem; min-width: 16px; }
  .quiz-question { font-size: 1rem; margin-bottom: 18px; }
  .quiz-wrap { padding: 24px 12px 80px; }
  .likert-labels { font-size: 0.78rem; }
}

/* iOS 慣性滾動 */
[style*="overflow:auto"], [style*="overflow-x:auto"], [style*="overflow-y:auto"],
[style*="overflow: auto"], [style*="overflow-x: auto"], [style*="overflow-y: auto"] {
  -webkit-overflow-scrolling: touch;
}

/* iOS 輸入框防縮放（font-size < 16px 會觸發 Safari 自動縮放） */
input, select, textarea {
  font-size: 16px !important;
}

/* scrollIntoView 防被固定 topnav（52px）遮住 */
[id] { scroll-margin-top: 64px; }
