/* AfternoonTime minimal, stable CSS
   Goals: clean layout, no black overlays, no hidden content by default,
   responsive nav, safe hero/slider, simple in-view animations. */

/* Import pages styles */
@import url('pages.css');

/* Q 版字體來源改為 Google Fonts：M PLUS Rounded 1c */

/* 套用至全站標題與 header 品牌字（使用可愛字體 + 繁中支援） */
h1, h2, h3, .brand-link {
  font-family: "LXGW WenKai TC", "M PLUS Rounded 1c", "Noto Serif TC", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  letter-spacing: 0.4px;
}

/* 工具類別：可愛字體（一般） */
.font-cute {
  font-family: "LXGW WenKai TC", "M PLUS Rounded 1c", "Noto Serif TC", system-ui, "PingFang TC", "Microsoft JhengHei", sans-serif;
}

/* 工具類別：可愛字體（強烈標題） */
.font-cute-strong {
  font-family: "LXGW WenKai TC", "M PLUS Rounded 1c", "Dela Gothic One", "Noto Serif TC", sans-serif;
  letter-spacing: 0.6px;
}

/* 關鍵基礎樣式 - 防止載入時跑版 */
html, body { 
    margin: 0; 
    padding: 0; 
    width: 100%; 
    /* 移除固定高度，讓滾動事件正常觸發 */
    overflow-x: hidden; /* 防止水平滾動 */
}

/* 確保頁面載入時的基本佈局 */
.l-inner { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 16px; 
    box-sizing: border-box;
}

.l-main { 
    margin-top: 0; 
    width: 100%;
    box-sizing: border-box;
}

/* Header基本樣式 */
.l-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* 品牌名稱樣式 */
.l-header__brand-text {
    font-size: 1.5em;
    font-weight: 600;
}

/* 初始狀態：半透明 */
body:not(.is-scrolled) .l-header {
    background: rgba(255, 255, 255, 0.5); /* 更透明的背景 */
    backdrop-filter: blur(0.5px); /* 進一步減少模糊效果 */
    box-shadow: 0 1px 8px rgba(0,0,0,0.02); /* 更輕微的陰影 */
}

/* 滾動狀態：不透明 */
body.is-scrolled .l-header {
    background: #fff;
    backdrop-filter: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.css-loaded .l-main {
    opacity: 1;
    visibility: visible;
}

/* 頁面載入動畫 */
#site_loader_overlay {
    position: fixed;
    z-index: 99999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.5s ease;
}

#site_loader_animation {
  width: 180px;
  height: 180px;
  background-size: contain;
    background-position: center;
  background-repeat: no-repeat;
    position: relative;
}

#site_loader_animation.c-load--logo {
  background-image: url('../images/logo-gray.png');
    opacity: 0;
  animation: fadeInOut 2s ease forwards;
}

#site_loader_animation.c-load--logo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  background-image: url('../images/logo-full.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  animation: fadeIn 1s ease 1s forwards;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 1; }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* ========== 01. Reset & Base ========== */
* { box-sizing: border-box; }
body {
    font-family: "FangSong", "仿宋", "FangSong_GB2312", "STFangsong", "華文仿宋", "Noto Serif TC", "Noto Serif SC", serif;
    color: #231815;
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; height: auto; }

/* Layout */
.l-inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.l-main { margin-top: 0; }

/* 手機版版面修正 */
@media (max-width: 767px) {
  .l-main { margin-top: 72px; }
  
  /* 調整手機版左右邊距 */
  .l-inner { 
    padding: 0 12px; 
  }
  
  /* 手機版按鈕調整 */
  .c-btn { 
    padding: 4px 8px;
    margin-left: 8px;
  }
  
  .c-btn__icon { 
    width: 14px; 
    height: 14px; 
    margin-right: 4px;
  }
  
  .c-btn__text {
    font-size: 11px;
  }
  
  /* 手機版header調整 */
  .l-header__actions { 
    gap: 6px; 
    margin-left: 8px; 
  }
}

/* ========== 02. Header & Nav ========== */
/* 基本header樣式已在上方定義 */
/* 滾動狀態樣式已在上方定義 */
.l-header__inner { height: 72px; display: flex; align-items: center; justify-content: space-between; }
.brand-link { font-weight: 700; letter-spacing: .2px; color: #231815; text-shadow: none; }
.is-scrolled .brand-link { color: #231815; text-shadow: none; }

/* Header字體採用Q版可愛風格（強制套用 + 繁中支援） */
.l-header, .l-header * {
  font-family: "LXGW WenKai TC", "M PLUS Rounded 1c", "Noto Serif TC", system-ui, "PingFang TC", "Microsoft JhengHei", sans-serif !important;
}

/* Menu button */
.p-menu-btn { position: relative; width: 30px; height: 30px; border: 0; background: none; cursor: pointer; display: none; }
.p-menu-btn::before, .p-menu-btn::after, .p-menu-btn .c-menu-btn__line {
  content: ""; position: absolute; left: 0; right: 0; height: 2px; background:#231815; border-radius: 2px; transition: transform .25s ease, opacity .25s ease, top .25s ease, bottom .25s ease;
}
.is-scrolled .p-menu-btn::before, .is-scrolled .p-menu-btn::after, .is-scrolled .p-menu-btn .c-menu-btn__line {
  background:#231815;
}
@media (max-width: 767px) {
  .p-menu-btn::before, .p-menu-btn::after, .p-menu-btn .c-menu-btn__line {
    background:#231815;
  }
}
.p-menu-btn::before { top: 8px; }
.p-menu-btn .c-menu-btn__line { top: 14px; }
.p-menu-btn::after { bottom: 8px; }
.p-menu-btn.is-active::before { top: 14px; transform: rotate(45deg); }
.p-menu-btn.is-active .c-menu-btn__line { opacity: 0; }
.p-menu-btn.is-active::after { bottom: 14px; transform: rotate(-45deg); }

/* Global nav */
.p-global-nav { 
  margin-left: auto; 
  display: block; /* 確保電腦版顯示 */
}
.p-global-nav ul { 
  list-style: none; 
  margin: 0; 
  padding: 0; 
  display: flex; 
  gap: 20px; 
}
.p-global-nav a { 
  display: block; 
  padding: 10px 12px; 
  border-radius: 6px; 
  transition: all .2s ease; /* 修改為所有屬性過渡 */
  color: #231815; 
  text-shadow: none;
  position: relative; /* 為懸停效果做準備 */
}
.p-global-nav a:hover { 
  background: rgba(0,0,0,.15); 
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
  transform: translateY(-1px);
  transition: all 0.2s ease;
}
.is-scrolled .p-global-nav a { color: #231815; text-shadow: none; }
.is-scrolled .p-global-nav a:hover { 
  background: rgba(0,0,0,.2); /* 滾動狀態下懸停效果更明顯 */
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
  transform: translateY(-1px);
  transition: all 0.2s ease;
}
.l-header__spacer { width: 20px; }

/* Header actions (icons) */
.l-header__actions { display: flex; align-items: center; gap: 10px; margin-left: 16px; }
.c-btn { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    padding: 12px;
    border-radius: 20px; 
    transition: transform 0.2s ease, background-color 0.2s ease; 
    background: transparent; 
    text-decoration: none;
    color: #333;
    margin-left: 12px;
    min-width: 48px;
    min-height: 48px;
}

.c-btn:hover { 
    transform: scale(1.05); 
    background-color: #f5f5f5;
}

.c-btn__icon { 
    width: 32px; 
    height: 32px; 
    display: inline-flex; 
    background-size: contain; 
    background-position: center; 
    background-repeat: no-repeat; 
    margin-right: 0;
}

.c-btn__icon svg { 
    width: 100%; 
    height: 100%; 
}

.c-btn__icon.shopee { 
    background-image: url('../images/shopee.png'); 
}

.c-btn__icon.youtube { 
    background-image: url('../images/youtube.png'); 
}

.c-btn__icon.line { 
    background-image: url('../images/line.png'); 
}

.c-btn__text {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

/* 特定按鈕樣式 */
.c-btn--shopee:hover {
    background-color: #ee4d2d;
    color: white;
}

.c-btn--youtube:hover {
    background-color: #ff0000;
    color: white;
}

.c-btn--shopee:hover .c-btn__text,
.c-btn--youtube:hover .c-btn__text {
    color: white;
}

.c-btn__label { display: none; /* 隱藏文字，只顯示圖標 */ }

/* Mobile nav */
@media (max-width: 767px) {
  .p-menu-btn { display: inline-block; }
  .p-global-nav { 
    display: none; 
    position: fixed; 
    left: 0; 
    right: 0; 
    top: 72px; 
    background:#fff; 
    box-shadow: 0 6px 16px rgba(0,0,0,.12); 
  }
  .p-global-nav.is-active { display: block; }
  .p-global-nav ul { flex-direction: column; gap: 0; }
  .p-global-nav li { border-bottom: 1px solid rgba(0,0,0,.06); }
  .p-global-nav a { color: #231815 !important; text-shadow: none !important; }
  .p-global-nav a:hover { 
    background: rgba(0,0,0,.25) !important; /* 手機版懸停效果更強烈 */
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); /* 添加內陰影增強視覺效果 */
  }
  .l-header__actions, .l-header__spacer { display: none; }
  /* 手機版header樣式繼承自基本樣式 */
  .brand-link { color: #231815 !important; text-shadow: none !important; }
  
  /* 手機版選單中的外部按鈕 */
  .mobile-actions { 
    padding: 20px; 
    border-top: 1px solid rgba(0,0,0,.06); 
    display: flex; 
    flex-direction: row; 
    gap: 12px; 
    justify-content: space-between; 
  }
  .mobile-actions .c-btn { 
    flex: 1; 
    justify-content: flex-start; 
    align-items: center;
    padding: 10px 12px; 
    font-size: 14px; 
    gap: 8px;
    border-radius: 6px;
    transition: all .2s ease;
    color: #231815;
  }
  .mobile-actions .c-btn:hover {
    background: rgba(0,0,0,.15);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
    transform: translateY(-1px);
  }
  .mobile-actions .c-btn__text { 
    display: inline-block !important; 
    margin-left: 0; 
    font-weight: 500;
  }
  .mobile-actions .c-btn__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }
  
  /* 手機版顯示emoji */
  .p-global-nav .menu-item a::before {
    content: attr(data-emoji);
    margin-right: 8px;
  }
}

/* 電腦版隱藏手機版按鈕 */
@media (min-width: 768px) {
  .mobile-actions {
    display: none;
  }
  
  /* 電腦版隱藏emoji */
  .p-global-nav .menu-item a::before {
    content: none;
  }
}

/* ========== 03. Hero / Slider (safe, no black) ========== */
.p-index-hero { position: relative; background:#f5f5f5; }
.p-index-slider { position: relative; min-height: clamp(480px, 100vh, 1200px); overflow: hidden; }
@media (max-width: 767px) {
  .p-index-slider { 
    min-height: clamp(200px, 56.25vw, 400px); /* 16:9比例 (9/16 = 0.5625 = 56.25%) */
    height: auto;
    aspect-ratio: 16/9;
  }
}
.p-index-slider__item { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; display: block !important; }
.p-index-slider__item:first-child, .p-index-slider__item.is-active { opacity: 1; }
.p-index-slider__item-media { position: absolute; inset: 0; overflow: hidden; z-index: 1; }
.p-index-slider__item-media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 767px) {
  .p-index-slider__item-media { 
    background-color: #f5f5f5; /* 背景色，避免圖片兩側空白 */
  }
  .p-index-slider__item-media img { 
    object-fit: contain; /* 確保圖片完整顯示不被裁切 */
    object-position: center;
  }
}
.p-index-slider__item::before { content: none; }
.p-index-slider__item-content { position: absolute; z-index: 2; top: 50%; left: 0; right: 0; transform: translateY(-50%); text-align: center; color: #fff; }
.p-index-slider__item-title { 
  font-size: clamp(24px, 4vw, 42px); 
  margin: 0; 
  text-shadow: 
    0 0 3px rgba(255, 255, 255, 0.9),
    0 0 5px rgba(255, 255, 255, 0.5),
    0 8px 24px rgba(0, 0, 0, 0.35);
  font-weight: 700;
  letter-spacing: 1px;
}
@media (max-width: 767px) {
  .p-index-slider__item-title {
    font-size: clamp(20px, 6vw, 28px);
    padding: 0 15px;
  }
}

/* Slider CTA nav (optional) */
.p-index-slider__nav { position: absolute; left: 50%; bottom: 10%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 3; list-style: none; padding: 0; margin: 0; }
.p-index-slider__nav-item a { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; color: #fff; background:#ee4d2d; border-radius: 999px; box-shadow: 0 6px 16px rgba(238,77,45,.3); }
.p-index-slider__nav-icon { width: 28px; height: 28px; display: inline-flex; background-size: contain; background-position: center; background-repeat: no-repeat; }
.p-index-slider__nav-icon.shopee { background-image: url('../images/shopee.png'); }
.p-index-slider__nav-icon.line { background-image: url('../images/line.png'); }
.p-index-slider__nav-icon.youtube { background-image: url('../images/youtube.png'); }

@media (max-width: 767px) {
  .p-index-slider__nav { bottom: 20px; }
  .p-index-slider__nav-item a { height: 38px; padding: 0 12px; }
  .p-index-slider__nav-text { font-size: 14px; }
}

/* ========== 04. Content blocks ========== */
.p-cb { padding: 56px 0; }
.p-index-section__content { padding: 40px 0; }
.p-index-section__content-desc { text-align: center; margin-bottom: 32px; }
.p-block05__upper { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
.p-block05__img { border-radius: 10px; overflow: hidden; }
.p-block05__lower { display: grid; gap: 20px; grid-template-columns: 1.1fr .9fr; align-items: center; margin-top: 20px; }
.p-block05__content { background:#fff; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.08); padding: 20px; }
.p-block05__content-title { margin: 0 0 8px; font-size: 22px; font-weight: 700; }

/* 區塊標題樣式 */
.l-inner { width: 88%; max-width: 1200px; margin: 0 auto; }
.p-section-header__upper { position: relative; height: 360px; background-size: cover; background-position: center; border-radius: 12px; overflow: hidden; }
.p-section-header__upper.is-video { height: auto; padding: 0; }

.p-section-header__lower { padding: 20px 0; }
.p-section-header__headline { text-align: center; margin: 0; font-size: 28px; position: relative; }
.p-section-header__headline-inner { position: relative; display: inline-block; padding: 0 10px; }
.p-section-header__headline-inner::after { content: ''; position: absolute; bottom: -8px; left: 0; width: 100%; height: 3px; background: #ee4d2d; }
.pt0 { padding-top: 0; }

/* 影片卡片樣式 */
.p-video-card { width: 100%; max-width: 1200px; margin: 0 auto; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.08); }
.p-video-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.p-video-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.p-video-actions { padding: 15px; background: #fff; text-align: center; }
.p-video-cta-btn { display: inline-block; padding: 10px 20px; background: #ee4d2d; color: #fff; border-radius: 999px; text-decoration: none; font-weight: bold; }
.p-video-cta-btn:hover { background: #ff6347; }

@media (max-width: 991px) {
  .p-block05__upper { grid-template-columns: repeat(2, 1fr); }
  .p-section-header__upper { height: 280px; }
}
@media (max-width: 767px) {
  .p-cb { padding: 36px 0; }
  .p-block05__upper, .p-block05__lower { grid-template-columns: 1fr; }
  .p-section-header__upper { height: 240px; }
}

/* ========== 05. Footer ========== */
.l-footer { background:#231815; color: #fff; }
.p-info { padding: 48px 0 32px; }
.p-info__inner { display: grid; gap: 40px; grid-template-columns: 1fr 1fr; }
.p-info__map iframe { width: 100%; height: 260px; border: 0; display: block; }
.p-info__map.no-badge::after { display: none !important; content: none !important; }
.p-info__company-info { margin: 0; }
.p-info__company-info p { margin: 0 0 8px; line-height: 1.6; }
@media (max-width: 991px) { .p-info__inner { grid-template-columns: 1fr; } }

.p-copyright { margin: 0; padding: 16px 0; text-align: center; background: #000; }

/* Back-to-top */
.p-pagetop { 
    position: fixed; 
    right: 20px; 
    bottom: 24px; 
    width: 56px; 
    height: 56px; 
    border-radius: 50%; 
    background: linear-gradient(135deg, #ff8c42, #ff6b35); 
    color: #fff; 
    display: none; 
    align-items: center; 
    justify-content: center; 
    z-index: 900; 
    box-shadow: 0 6px 20px rgba(255, 140, 66, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
}

.p-pagetop:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 140, 66, 0.6);
    background: linear-gradient(135deg, #ff9f5a, #ff7a42);
}

.p-pagetop.is-active { 
    display: flex; 
    animation: bounceIn 0.6s ease;
}

.p-pagetop a { 
    display: block; 
    width: 100%; 
    height: 100%; 
    text-decoration: none;
}

.p-pagetop a::before { 
    content: '⬆'; 
    display: grid; 
    place-items: center; 
    height: 100%; 
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    transform: translateY(-1px);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* LINE FAB */
.c-fab-line { 
    position: fixed; 
    right: 20px; 
    top: 50%; 
    transform: translateY(-50%); 
    width: 70px; 
    height: 70px; 
    border-radius: 50%; 
    background: #06c755; 
    color: #fff; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    box-shadow: 0 8px 20px rgba(0,0,0,.2); 
    z-index: 900; 
    /* 移除transition，讓JavaScript動畫正常運作 */
}


.c-fab-line__icon { 
    width: 60px; 
    height: 60px; 
    background-image: url('../images/line.png'); 
    background-size: contain; 
    background-position: center; 
    background-repeat: no-repeat; 
}

.c-fab-line__label { 
    display: none; 
}

/* Footer圖標特殊樣式 - 只影響footer中的圖標 */
.p-info__icons .c-btn__icon {
    width: 32px;
    height: 32px;
    margin-right: 0;
}

/* ========== 06. In-View animations (enhanced) ========== */
/* 基本淡入上移效果 */
.u-inview { 
    opacity: 0; 
  transform: translateY(32px); 
    transition: opacity .8s ease, transform .8s ease;
  will-change: opacity, transform;
}
.u-inview.is-inview { 
    opacity: 1;
    transform: translateY(0);
}
@media (max-width: 767px) {
  .u-inview {
    transform: translateY(16px);
  }
}

/* 延遲序列 */
.u-inview-delay-1 { transition-delay: 0.3s; }
.u-inview-delay-2 { transition-delay: 0.6s; }
.u-inview-delay-3 { transition-delay: 0.9s; }

/* 不同進入效果 */
.u-inview--fade { opacity: 0; transform: none; }
.u-inview--fade.is-inview { opacity: 1; }

.u-inview--right { opacity: 0; transform: translateX(40px); }
.u-inview--right.is-inview { opacity: 1; transform: translateX(0); }

.u-inview--left { opacity: 0; transform: translateX(-40px); }
.u-inview--left.is-inview { opacity: 1; transform: translateX(0); }

.u-inview--zoom { opacity: 0; transform: scale(0.9); }
.u-inview--zoom.is-inview { opacity: 1; transform: scale(1); }

/* 應用到子元素的序列動畫 */
.u-inview-children > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s ease, transform .8s ease;
}

.u-inview-children.is-inview > *:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.3s; }
.u-inview-children.is-inview > *:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.6s; }
.u-inview-children.is-inview > *:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.9s; }
.u-inview-children.is-inview > *:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 1.2s; }
.u-inview-children.is-inview > *:nth-child(5) { opacity: 1; transform: translateY(0); transition-delay: 1.5s; }
.u-inview-children.is-inview > *:nth-child(n+6) { opacity: 1; transform: translateY(0); transition-delay: 1.8s; }

/* Interactive cards hover (enhanced) */
.is-interactive-card { 
  transition: transform .25s ease, box-shadow .25s ease; 
  will-change: transform;
    opacity: 0;
  transform: translateY(24px);
}
.is-interactive-card.is-inview {
    opacity: 1;
    transform: translateY(0);
}
.is-interactive-card:hover { 
  transform: translateY(-4px); 
  box-shadow: 0 10px 24px rgba(0,0,0,.16); 
}

