/* ═══════════════════════════════════════════════════════════
   中天科技系統有限公司 — 全局設計令牌 / 基礎樣式
   視覺風格：雲端極簡 + 新擬態（Neumorphism）
   ═══════════════════════════════════════════════════════════ */

:root{
  /* ── 品牌色 ── */
  --brand:        #0C3579;   /* 主品牌色：深藍 */
  --brand-2:      #1E4FA3;
  --brand-3:      #16407F;
  --brand-deep:   #082A62;
  --tech:         #00A0E9;   /* 科技點綴色：亮藍 */
  --tech-2:       #57D2FF;
  --tech-3:       #EAF5FE;
  --wa-green:     #25D366;   /* WhatsApp 官方綠（僅用於全局懸浮聯絡按鈕） */

  /* ── 文字層級 ── */
  --ink:          #10233F;
  --ink-2:        #3C5580;
  --ink-3:        #6C82A3;
  --ink-4:        #93A7C0;
  --on-dark:      #FFFFFF;
  --on-dark-2:    rgba(255,255,255,.76);
  --on-dark-3:    rgba(255,255,255,.5);

  /* ── 背景與分隔 ── */
  --bg:           #FFFFFF;
  --bg-soft:      #F5F8FC;
  --bg-tint:      #EAF3FD;
  --bg-glass:     rgba(255,255,255,.72);
  --line:         #E4EDF9;
  --line-2:       #D6E4F5;

  /* ── 圓角（大圓角，摒棄生硬邊框） ── */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-2xl: 40px;
  --r-pill: 999px;

  /* ── 陰影（一律帶藍調半透明，不使用純黑） ── */
  --shadow-soft:   0 15px 35px rgba(12, 53, 121, 0.06);
  --shadow-card:   0 15px 35px rgba(12, 53, 121, 0.06), 0 2px 8px rgba(12, 53, 121, 0.04);
  --shadow-lift:   0 25px 50px rgba(12, 53, 121, 0.15);
  --shadow-hi:     0 30px 70px rgba(12, 53, 121, 0.14), 0 6px 16px rgba(12, 53, 121, 0.06);
  /* 新擬態：左上亮光、右下暗影 */
  --neu-out:       10px 10px 26px rgba(12, 53, 121, 0.08), -9px -9px 22px rgba(255, 255, 255, 0.95);
  --neu-out-sm:    6px 6px 16px rgba(12, 53, 121, 0.07), -6px -6px 14px rgba(255, 255, 255, 0.9);
  --neu-in:        inset 5px 5px 12px rgba(12, 53, 121, 0.07), inset -5px -5px 12px rgba(255, 255, 255, 0.95);
  --neu-hover:     16px 16px 38px rgba(12, 53, 121, 0.12), -10px -10px 26px rgba(255, 255, 255, 0.98);
  --shadow-tech:   0 14px 30px rgba(0, 160, 233, 0.28);

  /* ── 動效基準 ── */
  --ease:  cubic-bezier(0.25, 0.8, 0.25, 1);
  --ease-out-back: cubic-bezier(0.34, 1.2, 0.64, 1);
  --ease-elastic:  cubic-bezier(0.22, 1.35, 0.36, 1);
  --dur-hover: 300ms;
  --dur-scroll: 600ms;

  /* ── 字體（蘋方 / 思源黑體 / 微軟正黑體 繁中回退） ── */
  --font-sans: "PingFang TC", "PingFang HK", "Noto Sans TC", "Source Han Sans TC",
               "Microsoft JhengHei", "Microsoft YaHei", "Hiragino Sans GB",
               system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: "SF Pro Display", "Helvetica Neue", Arial, sans-serif;

  /* ── 佈局 ── */
  --container: 1240px;
  --nav-h: 76px;
}

/* ─────────────────────────── Reset ─────────────────────────── */
*,*::before,*::after{ box-sizing: border-box; }

html{
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body{
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.78;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

body.is-locked{ overflow: hidden; }

h1,h2,h3,h4,p,figure,blockquote,ul,ol,dl,dd{ margin: 0; }
ul,ol{ padding: 0; list-style: none; }
img,svg,video{ display: block; max-width: 100%; }
a{ color: inherit; text-decoration: none; }
button,input,select,textarea{ font: inherit; color: inherit; }
button{ background: none; border: 0; cursor: pointer; }
em,i{ font-style: normal; }

::selection{ background: rgba(0,160,233,.22); color: var(--brand); }

:focus-visible{
  outline: 2px solid var(--tech);
  outline-offset: 3px;
  border-radius: 6px;
}

.svg-sprite{ position: absolute; width: 0; height: 0; overflow: hidden; }

/* ─────────────────────────── 佈局工具 ─────────────────────────── */
.container{
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 32px;
}

section{ position: relative; }

.br-desk{ display: inline; }

/* ─────────────────────────── 圖標尺寸 ─────────────────────────── */
.ico{ width: 24px; height: 24px; flex: none; display: block; }
.ico--xs{ width: 16px; height: 16px; }
.ico--sm{ width: 20px; height: 20px; }
.ico--xl{ width: 56px; height: 56px; }

.ico--3d{
  width: 46px;
  height: 46px;
  filter: drop-shadow(0 10px 18px rgba(12, 53, 121, 0.22));
  transition: transform var(--dur-hover) var(--ease), filter var(--dur-hover) var(--ease);
}

/* ─────────────────────────── 標題與段落 ─────────────────────────── */
.sec-head{ max-width: 880px; margin-bottom: 56px; }
.sec-head--center{ margin-inline: auto; text-align: center; }

.sec-title{
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand);
}
.sec-title em{
  font-style: normal;
  background: linear-gradient(100deg, var(--tech) 0%, #2F7BE0 60%, var(--brand) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sec-title--center{ text-align: center; }
.sec-title--light{ color: var(--on-dark); }
.sec-title--light em{
  background: linear-gradient(100deg, var(--tech-2) 0%, var(--tech) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.sec-sub{
  margin-top: 22px;
  font-size: 18px;
  line-height: 1.8;
  color: var(--ink-3);
  max-width: 660px;
}
.sec-sub--center{ margin-inline: auto; text-align: center; }
.sec-sub--light{ color: var(--on-dark-2); }

/* 區塊小標籤（亮藍色文字） */
.eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--tech);
}
.eyebrow i{
  width: 22px; height: 3px;
  flex: none;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--tech-2), var(--tech));
}

/* ─────────────────────────── 按鈕 ─────────────────────────── */
.btn{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 32px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
  border-radius: var(--r-sm);
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  cursor: pointer;
  transition:
    transform var(--dur-hover) var(--ease),
    box-shadow var(--dur-hover) var(--ease),
    background-color var(--dur-hover) var(--ease),
    color var(--dur-hover) var(--ease),
    border-color var(--dur-hover) var(--ease);
}

.btn--capsule{ border-radius: var(--r-pill); }
.btn--lg{ padding: 18px 40px; font-size: 17px; }
.btn--sm{ padding: 11px 22px; font-size: 15px; }
.btn--full{ width: 100%; }

.btn--primary{
  color: #fff;
  background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 55%, var(--brand-deep) 100%);
  box-shadow: 0 12px 26px rgba(12, 53, 121, 0.24), inset 0 1px 0 rgba(255,255,255,.22);
}
/* 以內陰影鋪滿作為懸停變色層，可平滑過渡 */
.btn--primary:hover{
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    0 20px 44px rgba(12, 53, 121, 0.32),
    0 0 0 6px rgba(0, 160, 233, 0.12),
    inset 0 0 0 999px rgba(0, 160, 233, 0.55),
    inset 0 1px 0 rgba(255,255,255,.28);
}
.btn--primary:active{ transform: translateY(0) scale(.99); }

.btn--ghost{
  color: var(--brand);
  background: rgba(255,255,255,.9);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-soft);
}
.btn--ghost:hover{
  transform: translateY(-2px) scale(1.03);
  color: var(--tech);
  border-color: rgba(0,160,233,.45);
  box-shadow: 0 18px 36px rgba(12,53,121,.12);
}

/* 水波紋 */
.ripple{ position: relative; }
.ripple .rp{
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.55);
  transform: scale(0);
  animation: rippleOut 620ms var(--ease) forwards;
  pointer-events: none;
}
.btn--ghost .ripple .rp,
.ripple .rp.rp--dark{ background: rgba(0,160,233,.32); }

@keyframes rippleOut{
  to{ transform: scale(2.6); opacity: 0; }
}

/* ─────────────────────────── 標籤 ─────────────────────────── */
.tags{ display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tags li{
  padding: 7px 15px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--brand);
  background: rgba(234, 243, 253, .9);
  border-radius: var(--r-pill);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
  transition: all var(--dur-hover) var(--ease);
}
.tags--ghost li{
  color: var(--on-dark-2);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: none;
}

/* ─────────────────────────── 滾動入場（進入視口 20% 開始，600ms） ─────────────────────────── */
.reveal{
  transition:
    opacity var(--dur-scroll) var(--ease),
    transform var(--dur-scroll) var(--ease);
  transition-delay: var(--rd, 0ms);
  will-change: opacity, transform;
}
/* 僅在 JS 可用時才隱藏，確保無腳本環境仍可正常閱讀 */
.js .reveal{ opacity: 0; transform: translateY(30px); }
.js .reveal.is-in{ opacity: 1; transform: translateY(0); }

/* ─────────────────────────── 1. 導航欄（懸浮膠囊式） ─────────────────────────── */
.site-nav{
  position: fixed;
  top: 18px;
  left: 0;
  right: 0;
  z-index: 900;
  padding-inline: 24px;
  transition: top var(--dur-hover) var(--ease);
}

.nav-inner{
  position: relative;
  display: flex;
  align-items: center;
  gap: 26px;
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding: 10px 12px 10px 22px;
  border-radius: var(--r-pill);
  background: transparent;
  border: 1px solid transparent;
  transition:
    background-color var(--dur-hover) var(--ease),
    backdrop-filter var(--dur-hover) var(--ease),
    box-shadow var(--dur-hover) var(--ease),
    border-color var(--dur-hover) var(--ease),
    padding var(--dur-hover) var(--ease);
}

.site-nav.is-stuck .nav-inner{
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-color: rgba(255,255,255,.7);
  box-shadow: 0 10px 34px rgba(12, 53, 121, 0.09), inset 0 1px 0 rgba(255,255,255,.9);
}
.site-nav.is-stuck{ top: 12px; }

.nav-logo{ display: flex; align-items: center; flex: none; }
/* Logo 圖片載入失敗時的文字回退 */
.logo-fallback{
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--brand);
}
.footer-logo + .logo-fallback, .footer-brand .logo-fallback{ color: #fff; }
.nav-logo img{
  /* 橫版標誌原圖比例 3.31:1；高度鎖在 40–44px 區間，寬度按原比例自動縮放（嚴禁拉伸） */
  height: 42px;
  width: auto;
  /* logo-dark.png / logo-mark.png 皆為去背透明 PNG，任何背景皆可正確顯示，無需混合模式 */
  transition: transform var(--dur-hover) var(--ease), height var(--dur-hover) var(--ease);
}
.nav-logo:hover img{ transform: scale(1.03); }

/* LOGO 隨導航欄一起淡入（載入時 opacity 0→1、translateY -10px→0，400ms） */
@keyframes logoIn{
  from{ opacity: 0; transform: translateY(-10px); }
  to{ opacity: 1; transform: translateY(0); }
}
.js .nav-logo{ animation: logoIn 400ms var(--ease) both; }

.nav-menu{
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.nav-item{ position: relative; }

.nav-link{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--brand);
  border-radius: var(--r-pill);
  transition: color var(--dur-hover) var(--ease), background-color var(--dur-hover) var(--ease),
              transform var(--dur-hover) var(--ease);
}
.nav-link::after{
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--tech), transparent);
  transform: translateX(-50%);
  transition: width var(--dur-hover) var(--ease);
}
.nav-link:hover{
  color: var(--tech);
  transform: translateX(4px);   /* 向右平移 4px */
}
.nav-link:hover::after{ width: 60%; }

.nav-caret{ transition: transform var(--dur-hover) var(--ease); }
.nav-item--drop.is-open .nav-caret{ transform: rotate(180deg); }

/* 下拉菜單：500ms 彈性緩動向下展開 */
.nav-dropdown{
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  width: 330px;
  padding: 12px;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.94);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255,255,255,.8);
  box-shadow: 0 26px 60px rgba(12, 53, 121, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -12px) scale(.96);
  transform-origin: top center;
  transition:
    opacity 500ms var(--ease-elastic),
    transform 500ms var(--ease-elastic),
    visibility 500ms;
}
.nav-item--drop:hover .nav-dropdown,
.nav-item--drop.is-open .nav-dropdown{
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}

.nav-dropdown a{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  transition: background-color var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease);
}
.nav-dropdown a + a{ margin-top: 2px; }
.nav-dropdown a:hover{
  background: linear-gradient(100deg, rgba(234,245,254,.95), rgba(255,255,255,.6));
  transform: translateX(4px);
}
.nd-ico{
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  color: var(--brand);
  background: #fff;
  box-shadow: var(--neu-out-sm);
  transition: all var(--dur-hover) var(--ease);
}
.nav-dropdown a:hover .nd-ico{
  color: #fff;
  background: linear-gradient(135deg, var(--tech), var(--brand-2));
  box-shadow: var(--shadow-tech);
}
.nav-dropdown b{
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand);
  transition: color var(--dur-hover) var(--ease);
}
.nav-dropdown i{ display: block; font-size: 12.5px; color: var(--ink-4); line-height: 1.5; }
.nav-dropdown a:hover b{ color: var(--tech); }

.nav-actions{ display: flex; align-items: center; gap: 12px; flex: none; }

/* 只在行動版抽屜選單內顯示的 CTA */
.nav-cta{ display: none; }

/* 語言切換 */
.lang-switch{ position: relative; }
.lang-btn{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,.7);
  transition: all var(--dur-hover) var(--ease);
}
.lang-btn:hover{
  color: var(--tech);
  border-color: rgba(0,160,233,.4);
  box-shadow: 0 8px 20px rgba(12,53,121,.1);
}
.lang-current{ min-width: 16px; text-align: center; }
.lang-menu{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 148px;
  padding: 8px;
  border-radius: var(--r-md);
  background: rgba(255,255,255,.96);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  box-shadow: 0 20px 44px rgba(12,53,121,.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--dur-hover) var(--ease);
}
.lang-switch.is-open .lang-menu{ opacity: 1; visibility: visible; transform: translateY(0); }
.lang-menu button{
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--ink-2);
  border-radius: 10px;
  transition: all var(--dur-hover) var(--ease);
}
.lang-menu button:hover{ background: var(--tech-3); color: var(--brand); }
.lang-menu button.is-active{ color: var(--tech); font-weight: 600; background: var(--tech-3); }

/* 漢堡按鈕 */
.nav-burger{ display: none; width: 42px; height: 42px; border-radius: 12px; padding: 12px 10px; }
.nav-burger span{
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
  transition: transform var(--dur-hover) var(--ease), opacity var(--dur-hover) var(--ease);
}
.nav-burger span + span{ margin-top: 5px; }
.nav-burger[aria-expanded="true"] span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

/* ─────────────────────────── 12. 頁腳 ─────────────────────────── */
.footer{
  position: relative;
  padding: 92px 0 34px;
  background:
    radial-gradient(1000px 520px at 12% -10%, rgba(0,160,233,.24) 0%, transparent 62%),
    radial-gradient(800px 460px at 88% 6%, rgba(30,79,163,.36) 0%, transparent 60%),
    linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: var(--on-dark-2);
  overflow: hidden;
}
.footer-glow{
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,160,233,.6), transparent);
}
.footer-grid{
  display: grid;
  grid-template-columns: 1.8fr .72fr .72fr 1.05fr 1.2fr;
  gap: 44px 34px;
  align-items: start;
}
.footer-logo{
  /* logo-white.png 為去背純白 PNG，於深藍底上直接顯示；高度鎖 32–36px */
  height: 36px;
  width: auto;
  max-width: 100%;
  opacity: 1;
}
.footer-brand p{ margin-top: 22px; font-size: 14.5px; line-height: 1.9; color: var(--on-dark-3); max-width: 340px; }
.footer-social{ display: flex; gap: 10px; margin-top: 24px; }
.footer-social a{
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 13px;
  color: #fff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  transition: all var(--dur-hover) var(--ease);
}
.footer-social a:hover{
  transform: translateY(-4px);
  background: linear-gradient(135deg, var(--tech), var(--brand-2));
  box-shadow: 0 12px 26px rgba(0,160,233,.35);
  border-color: transparent;
}

.footer-col h4{
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 22px;
  letter-spacing: .02em;
}
.footer-col ul{ display: grid; gap: 13px; }
.footer-col ul a{
  position: relative;
  font-size: 14.5px;
  color: var(--on-dark-3);
  transition: color var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease);
  display: inline-block;
}
.footer-col ul a:hover{ color: var(--tech-2); transform: translateX(4px); }

.footer-contact li{ display: flex; gap: 11px; align-items: flex-start; font-size: 14.5px; color: var(--on-dark-3); }
.footer-contact .ico{ margin-top: 5px; color: var(--tech-2); opacity: .9; }
.footer-hours{ margin-top: 18px; font-size: 13px; color: var(--on-dark-3); }

.footer-col--cta p{ font-size: 14.5px; line-height: 1.85; color: var(--on-dark-3); margin-bottom: 20px; }
/* 深藍底上改用白底按鈕，確保對比度 */
.footer-col--cta .btn{
  color: var(--brand);
  background: #FFFFFF;
  box-shadow: 0 16px 34px rgba(3, 16, 40, 0.34);
}
.footer-col--cta .btn:hover{
  color: #fff;
  box-shadow:
    0 22px 46px rgba(0, 160, 233, 0.42),
    inset 0 0 0 999px rgba(0, 160, 233, 0.92);
}
.footer-badge{
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--tech-2);
}
.footer-badge i{
  width: 7px; height: 7px; border-radius: 50%;
  background: #4BE39B;
  box-shadow: 0 0 0 4px rgba(75,227,155,.18);
  animation: pulseDot 2.4s var(--ease) infinite;
}
@keyframes pulseDot{
  0%,100%{ box-shadow: 0 0 0 4px rgba(75,227,155,.18); }
  50%    { box-shadow: 0 0 0 9px rgba(75,227,155,0); }
}

.footer-bottom{
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 70px;
  padding-top: 26px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 13.5px;
  color: var(--on-dark-3);
}
.footer-bottom ul{ display: flex; gap: 26px; }
.footer-bottom a{ transition: color var(--dur-hover) var(--ease); }
.footer-bottom a:hover{ color: var(--tech-2); }

/* ─────────────────── 全局 WhatsApp 懸浮按鈕 ─────────────────── */
/* 固定右下角：bottom 40 / right 40，直徑 60px；「返回頂部」固定排列於其上方 16px */
.wa-float{
  position: fixed;
  right: 40px;
  bottom: 40px;
  z-index: 9999;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--wa-green);
  /* 柔和新擬態陰影：綠色調擴散，非生硬邊框；內側極細白色半透明描邊 */
  box-shadow: 0 12px 30px rgba(37, 211, 102, .40),
              inset 0 0 0 1px rgba(255, 255, 255, .30);
  opacity: 0;
  transform: translateY(30px);
  /* 入場：延遲 1s（由 JS 加 .is-in），時長 600ms */
  transition: opacity 600ms var(--ease), transform 600ms var(--ease),
              box-shadow 600ms var(--ease);
  -webkit-tap-highlight-color: transparent;
  will-change: transform, opacity;
}
.wa-float.is-in{ opacity: 1; transform: translateY(0); }

/* 滾動時提升層級感：描邊與陰影略增，讀作「浮在內容之上」 */
.wa-float.is-scrolled{
  box-shadow: 0 16px 36px rgba(37, 211, 102, .48),
              inset 0 0 0 1px rgba(255, 255, 255, .44);
}

.wa-ico{
  width: 30px;
  height: 30px;
  /* whatsapp.png 為純白去背圖標，疊在綠色底上即為官方標誌外觀 */
  pointer-events: none;
}

.wa-tip{
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  background: #fff;
  border-radius: 12px;
  white-space: nowrap;
  box-shadow: 0 10px 26px rgba(12, 53, 121, .14);
  opacity: 0;
  visibility: hidden;
  transform: translate(10px, -50%);
  pointer-events: none;
  transition: opacity var(--dur-hover) var(--ease),
              transform var(--dur-hover) var(--ease),
              visibility var(--dur-hover) var(--ease);
}
.wa-tip::after{                       /* 氣泡指向按鈕的小尖角 */
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  margin-top: -5px;
  border: 5px solid transparent;
  border-left-color: #fff;
}

/* 懸停：放大 1.1、陰影急劇擴散、圖標彈跳、氣泡自右側滑出 */
.wa-float:hover,
.wa-float:focus-visible{
  transform: translateY(0) scale(1.1);
  box-shadow: 0 20px 40px rgba(37, 211, 102, .60),
              inset 0 0 0 1px rgba(255, 255, 255, .45);
}
.wa-float:hover .wa-ico,
.wa-float:focus-visible .wa-ico{ animation: waBounce 300ms var(--ease); }
@keyframes waBounce{
  0%{ transform: translateY(0); }
  45%{ transform: translateY(-4px); }
  100%{ transform: translateY(0); }
}
.wa-float:hover .wa-tip,
.wa-float:focus-visible .wa-tip{
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}

/* 點擊回饋：200ms 內縮至 .95 後回彈 */
.wa-float:active{
  transform: translateY(0) scale(.95);
  transition-duration: 200ms;
}

/* 持續微動效：每 30 秒一次呼吸縮放（1.0→1.05→1.0，時長 1.5s）
   以獨立 scale 屬性實作，不與 transform 的 hover 縮放互相覆蓋 */
@keyframes waBreath{
  0%{   scale: 1; }
  2.5%{ scale: 1.05; }
  5%{   scale: 1; }
  100%{ scale: 1; }
}
.wa-float.is-in{ animation: waBreath 30s ease-in-out 30s infinite; }

/* ─────────────────────────── 返回頂部 ─────────────────────────── */
.to-top{
  position: fixed;
  right: 40px;
  /* 40（WhatsApp 下緣）+ 60（直徑）+ 16（間距）= 116 */
  bottom: 116px;
  z-index: 800;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: var(--brand);
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 50%;
  box-shadow: var(--neu-out);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  transition: all var(--dur-hover) var(--ease);
}
.to-top.is-visible{ opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover{
  transform: translateY(-6px);
  color: #fff;
  background: linear-gradient(135deg, var(--tech), var(--brand-2));
  box-shadow: 0 18px 38px rgba(12,53,121,.28);
  border-color: transparent;
}
.to-top:active{ transform: translateY(-2px) scale(.96); }

/* ─────────────────────────── Toast ─────────────────────────── */
.toast{
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 1200;
  padding: 14px 26px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--brand);
  background: rgba(255,255,255,.96);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: 0 22px 50px rgba(12,53,121,.18);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 16px);
  transition: all 420ms var(--ease-elastic);
}
.toast.is-show{ opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ─────────────────────────── 無障礙：降低動效 ─────────────────────────── */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *,*::before,*::after{
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal{ opacity: 1 !important; transform: none !important; }
  /* LOGO 與懸浮按鈕：取消位移與呼吸，僅保留最終可見狀態 */
  .js .nav-logo{ animation: none; opacity: 1; transform: none; }
  .js .nav-logo img{ transition: none; }
  .wa-float,
  .wa-float.is-in{ transition: none; animation: none; opacity: 1; transform: none; }
  .wa-float:hover, .wa-float:focus-visible, .wa-float:active{ transform: none; }
  .wa-float:hover .wa-ico, .wa-float:focus-visible .wa-ico{ animation: none; }
}
