/* ==========================================================================
   STARBAY MEDIA — Global Stylesheet (v3, Vibe-inspired)
   China-safe: no external fonts, no Google CDN, no GTM/YouTube/Maps hard dep.
   Pure Vanilla CSS + JS motion. Works fully offline.
   Built for the Starbay custom WordPress PHP theme. No page builder dependency.

   ----------------------------------------------------------------------------
   改色一鍵說明 / How to re-brand:
   只需修改下方 :root 內的核心變數即可全站換色。
     --sb-accent  主強調色（CTA、連結、高亮）= 青綠
     --sb-gold    香檳金（次強調、勳章、邊框光暈）
     --sb-cyan    青／藍青（資料、統計、科技感點綴）
     --sb-bg      全站背景（深邃海軍藍／黑）
     --sb-surface 卡片／面板表面
     --sb-border  邊框
     --sb-radius  圓角
     --sb-ease    動效緩動曲線
   ----------------------------------------------------------------------------
   ========================================================================== */

/* ----- 1. Design Tokens (v3 Starbay brand) ----- */
:root {
  /* === 核心可換色變數 Core re-brand variables === */
  --sb-accent: #19C3B8;            /* 青綠 teal/cyan-green — 主強調色 */
  --sb-accent-hi: #34E3D6;         /* 主強調 hover */
  --sb-gold: #D9B26A;              /* 香檳金 champagne gold */
  --sb-gold-hi: #EBC988;
  --sb-cyan: #4FA8E0;              /* 青／藍青 cyan-blue */

  --sb-bg: #070B12;                /* 深邃海軍藍／黑 deep navy-black */
  --sb-surface: #111723;           /* 卡片表面 */
  --sb-border: rgba(217,178,106,.14); /* 帶金調的細邊框 */
  --sb-radius: 16px;
  --sb-ease: cubic-bezier(.2,.8,.2,1);

  /* === 衍生／向後相容別名 Derived & back-compat aliases === */
  --sb-bg-alt: #0B1119;
  --sb-surface-hi: #18202E;
  --sb-border-hi: rgba(255,255,255,.16);

  --sb-text: #ECEFF4;
  --sb-text-muted: #A4B0BE;
  --sb-text-faint: #6B7686;

  /* primary 對映到 accent，舊樣式不需大改 */
  --sb-primary: var(--sb-accent);
  --sb-primary-hi: var(--sb-accent-hi);
  --sb-danger: #E55A6D;

  /* 光暈 glow tokens */
  --sb-accent-glow: rgba(25,195,184,.40);
  --sb-gold-glow: rgba(217,178,106,.32);
  --sb-radius-sm: 12px;

  /* Type scale */
  --sb-font-cjk: "PingFang TC","PingFang HK","Microsoft JhengHei","Heiti TC","Noto Sans CJK TC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  --sb-font-sans: -apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,Roboto,"Helvetica Neue",Arial,sans-serif;
  --sb-font: var(--sb-font-cjk), var(--sb-font-sans);

  --sb-fs-hero: 34px;
  --sb-fs-h1: 30px;
  --sb-fs-h2: 24px;
  --sb-fs-h3: 19px;
  --sb-fs-body: 16px;
  --sb-fs-small: 14px;

  /* Layout */
  --sb-container: 1200px;
  --sb-radius: 8px;
  --sb-radius-sm: 8px;
  --sb-shadow: 0 10px 30px rgba(0,0,0,.35);
  --sb-gap: 24px;
}

/* ----- 2. Theme visibility defaults -----
   Content remains visible by default. Interactive JS progressively enhances
   navigation, FAQ and modal behavior without hiding essential content. */
.sb-page,
.sb-page * {
  visibility: visible;
  opacity: 1;
}

/* ----- 3. Reset within Starbay scope ----- */
.sb-page {
  font-family: var(--sb-font);
  font-size: var(--sb-fs-body);
  line-height: 1.7;
  color: var(--sb-text);
  background: var(--sb-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.sb-page *, .sb-page *::before, .sb-page *::after { box-sizing: border-box; }
.sb-page img, .sb-page video { max-width: 100%; height: auto; display: block; }
.sb-page a { color: var(--sb-primary); text-decoration: none; transition: color .2s ease; }
.sb-page a:hover { color: var(--sb-primary-hi); }
.sb-page h1, .sb-page h2, .sb-page h3, .sb-page h4 { margin: 0 0 .6em; line-height: 1.25; font-weight: 700; color: var(--sb-text); }
.sb-page h1 { font-size: var(--sb-fs-h1); }
.sb-page h2 { font-size: var(--sb-fs-h2); }
.sb-page h3 { font-size: var(--sb-fs-h3); }
.sb-page p { margin: 0 0 1em; color: var(--sb-text); }
.sb-page ul, .sb-page ol { padding-left: 1.2em; margin: 0 0 1em; }
.sb-page li { margin-bottom: .3em; }

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

.sb-eyebrow {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--sb-primary);
  margin-bottom: 14px;
  font-weight: 600;
}

.sb-section { padding: 56px 0; position: relative; }
.sb-section--compact { padding: 28px 0; }
.sb-section--alt { background: var(--sb-bg-alt); }
.sb-section--surface { background: var(--sb-surface); }

/* ----- 4. Buttons & CTA ----- */
.sb-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0;
  transition: transform .15s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}
.sb-btn--primary { background: var(--sb-accent); color: #04161A; box-shadow: 0 0 0 0 var(--sb-accent-glow); }
.sb-btn--primary:hover { background: var(--sb-accent-hi); color: #04161A; transform: translateY(-1px); box-shadow: 0 8px 30px -6px var(--sb-accent-glow); }
.sb-btn--gold { background: var(--sb-gold); color: #1A1206; }
.sb-btn--gold:hover { background: var(--sb-gold-hi); color: #1A1206; transform: translateY(-1px); box-shadow: 0 8px 30px -6px var(--sb-gold-glow); }
.sb-btn--ghost { background: transparent; color: var(--sb-text); border-color: var(--sb-border-hi); }
.sb-btn--ghost:hover { border-color: var(--sb-primary); color: var(--sb-primary-hi); }
.sb-btn--wa { background: #25D366; color: #04161A; }
.sb-btn--wa:hover { background: #2FE07A; color: #04161A; }
.sb-btn--wc { background: var(--sb-surface-hi); color: var(--sb-text); border-color: var(--sb-border-hi); }

.sb-cta-band {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #0C1A22 0%, #0A1018 55%, #120D06 100%);
  border-top: 1px solid var(--sb-border);
  border-bottom: 1px solid var(--sb-border);
  padding: 64px 24px;
  text-align: center;
}
.sb-cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--sb-cta-bg);
  background-size: cover;
  background-position: center;
  opacity: .22;
}
.sb-cta-band > * { position: relative; z-index: 1; }
.sb-cta-band h2 { margin-bottom: 8px; }
.sb-cta-band p { color: var(--sb-text-muted); margin-bottom: 28px; }
.sb-cta-band .sb-btn { margin: 6px; }

/* ----- 5. Hero with CSS motion background ----- */
.sb-hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 56px;
  background: #0B0F14;
}
.sb-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11,15,20,.94) 0%, rgba(11,15,20,.72) 55%, rgba(11,15,20,.56) 100%),
    linear-gradient(180deg, rgba(11,15,20,.05) 0%, #0F141B 100%);
  z-index: 1;
}
.sb-hero__inner { position: relative; z-index: 2; display: grid; gap: 32px; align-items: center; }
.sb-hero__copy { max-width: 760px; }
.sb-hero h1 { font-size: var(--sb-fs-hero); }
.sb-hero p.sb-lead { font-size: 17px; color: var(--sb-text-muted); margin: 18px 0 32px; max-width: 720px; }
.sb-hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.sb-hero__media {
  position: relative;
  min-height: 260px;
  border-radius: var(--sb-radius);
  overflow: hidden;
  border: 1px solid var(--sb-border);
  background: var(--sb-surface);
}
.sb-hero__image {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  object-position: center;
}
.sb-hero__image--desktop { display: none; }
.sb-hero__image--mobile { display: block; }

/* Animated motion background (pure CSS) */
.sb-motion-bg {
  position: absolute; inset: 0; z-index: 1; overflow: hidden;
  pointer-events: none;
}
.sb-motion-bg { display: none; }
.sb-motion-bg::before,
.sb-motion-bg::after {
  content: ""; position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .55;
  will-change: transform;
}
.sb-motion-bg::before {
  width: 580px; height: 580px;
  background: radial-gradient(circle, var(--sb-accent) 0%, transparent 60%);
  top: -180px; left: -120px;
  animation: sb-orbit-a 22s ease-in-out infinite alternate;
}
.sb-motion-bg::after {
  width: 520px; height: 520px;
  background: radial-gradient(circle, var(--sb-gold) 0%, transparent 60%);
  top: 30%; right: -160px;
  animation: sb-orbit-b 28s ease-in-out infinite alternate;
}
.sb-motion-bg .sb-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(80% 60% at 50% 40%, #000 30%, transparent 80%);
  opacity: .6;
}
@keyframes sb-orbit-a { from { transform: translate(0,0) scale(1); } to { transform: translate(140px, 80px) scale(1.1); } }
@keyframes sb-orbit-b { from { transform: translate(0,0) scale(1); } to { transform: translate(-120px, 60px) scale(1.08); } }
@media (prefers-reduced-motion: reduce) {
  .sb-motion-bg::before, .sb-motion-bg::after { animation: none; }
}

/* Optional self-hosted MP4 hero — drop a <video class="sb-hero-video"> inside .sb-hero */
.sb-hero-video {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover; opacity: .35;
}

/* ----- 6. Cards & Grids ----- */
.sb-grid { display: grid; gap: var(--sb-gap); }
.sb-grid--2,
.sb-grid--3,
.sb-grid--4 { grid-template-columns: 1fr; }

.sb-card {
  position: relative;
  overflow: hidden;
  background: var(--sb-surface);
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius);
  padding: 28px;
  transition: transform .4s var(--sb-ease), border-color .4s var(--sb-ease), background .4s var(--sb-ease), box-shadow .4s var(--sb-ease);
}
/* === Vibe 卡片 hover 光暈 (純 CSS，無 JS 依賴) === */
.sb-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle, var(--sb-accent) 0%, transparent 60%);
  opacity: 0;
  filter: blur(60px);
  transition: opacity .4s var(--sb-ease);
  z-index: 0;
  pointer-events: none;
}
.sb-card > * { position: relative; z-index: 1; }
.sb-card__media {
  margin: -28px -28px 22px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--sb-surface-hi);
}
.sb-card__image,
.sb-case-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sb-card:hover { border-color: var(--sb-gold); transform: translateY(-4px); background: var(--sb-surface-hi); box-shadow: 0 18px 40px -18px var(--sb-gold-glow); }
.sb-card:hover::before { opacity: .14; }
/* 金色卡片 hover 變金光 */
.sb-card--gold:hover::before { background: radial-gradient(circle, var(--sb-gold) 0%, transparent 60%); }
.sb-card h3 { margin-bottom: 10px; }
.sb-card p { color: var(--sb-text-muted); margin-bottom: 12px; }
.sb-card a.sb-card__more { color: var(--sb-primary); font-weight: 600; }

.sb-case-card {
  background: var(--sb-surface);
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius);
  overflow: hidden;
}
.sb-case-card__img { aspect-ratio: 16/9; background: var(--sb-surface-hi); overflow: hidden; }
.sb-case-card__body { padding: 24px; }
.sb-case-card__tag { font-size: 12px; letter-spacing: 0; color: var(--sb-primary); text-transform: uppercase; }
.sb-case-card h3 { margin: 8px 0 10px; font-size: 19px; }
.sb-case-card p { color: var(--sb-text-muted); font-size: 15px; }
.sb-case-card__meta,
.sb-case-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sb-case-card__meta { margin: 0 0 12px; }
.sb-case-card__meta span,
.sb-case-meta div {
  border: 1px solid var(--sb-border);
  background: rgba(255,255,255,.03);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--sb-text-muted);
  font-size: 13px;
}
.sb-case-meta div {
  display: grid;
  gap: 2px;
  border-radius: var(--sb-radius-sm);
  min-width: 150px;
}
.sb-case-meta span { color: var(--sb-text-faint); font-size: 12px; }
.sb-case-meta strong { color: var(--sb-text); font-size: 14px; }

.sb-media-copy {
  display: grid;
  gap: 28px;
  align-items: center;
}
.sb-inline-media {
  margin: 0;
  border-radius: var(--sb-radius);
  overflow: hidden;
  border: 1px solid var(--sb-border);
  background: var(--sb-surface);
}
.sb-inline-media .sb-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.sb-gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 82%);
  gap: 14px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scroll-snap-type: x proximity;
}
.sb-gallery__item {
  margin: 0;
  scroll-snap-align: start;
  border-radius: var(--sb-radius);
  overflow: hidden;
  border: 1px solid var(--sb-border);
  background: var(--sb-surface);
}
.sb-gallery__item .sb-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.sb-gallery__item figcaption {
  padding: 10px 12px;
  color: var(--sb-text-muted);
  font-size: 13px;
}
.sb-note {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius);
  background: var(--sb-surface);
  color: var(--sb-text-muted);
}

/* ----- 7. FAQ ----- */
.sb-faq { display: flex; flex-direction: column; gap: 12px; }
.sb-faq__item {
  background: var(--sb-surface);
  border: 1px solid var(--sb-border);
  border-radius: var(--sb-radius-sm);
  padding: 22px 24px;
}
.sb-faq__item h3 {
  font-size: 17px;
  margin: 0 0 10px;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  min-height: 44px;
}
.sb-faq__item h3::after {
  content: "+";
  color: var(--sb-primary);
  font-size: 22px; line-height: 1;
  transition: transform .2s ease;
  flex-shrink: 0;
}
.sb-faq__item[data-open="true"] h3::after { content: "−"; }
.sb-faq__item p { color: var(--sb-text-muted); margin: 0; }
/* If JS disabled, content stays visible */
.sb-faq__item p { display: block; }
.sb-faq__item[data-js-ready="true"] p { display: none; }
.sb-faq__item[data-js-ready="true"][data-open="true"] p { display: block; }

/* ----- 8. Government deliverables table ----- */
.sb-table-wrap { overflow-x: auto; border-radius: var(--sb-radius); border: 1px solid var(--sb-border); }
.sb-table { width: 100%; border-collapse: collapse; background: var(--sb-surface); min-width: 720px; }
.sb-table th, .sb-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--sb-border); font-size: 15px; vertical-align: top; }
.sb-table th { background: var(--sb-surface-hi); color: var(--sb-text); font-weight: 600; }
.sb-table tr:last-child td { border-bottom: none; }

/* ----- 9. Header / Footer ----- */
.sb-header {
  position: sticky; top: 0; z-index: 90;
  background: rgba(11,15,20,.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--sb-border);
}
.sb-header__inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; max-width: var(--sb-container); margin: 0 auto; gap: 24px; }
.sb-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--sb-text); }
.sb-logo img { height: 32px; width: auto; }
.sb-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--sb-bg-alt);
  flex-direction: column;
  padding: 14px 18px;
  border-bottom: 1px solid var(--sb-border);
  gap: 8px;
}
.sb-nav[data-open="true"] { display: flex; }
.sb-nav a { color: var(--sb-text); font-size: 15px; }
.sb-nav a { min-height: 44px; display: flex; align-items: center; width: 100%; }
.sb-nav a:hover { color: var(--sb-primary); }
.sb-nav__group { position: relative; }
.sb-nav__dropdown {
  position: static;
  background: transparent;
  border: 0;
  border-radius: var(--sb-radius-sm);
  padding: 0 0 0 14px;
  min-width: 0;
  display: block;
  box-shadow: none;
}
.sb-nav__group:hover .sb-nav__dropdown,
.sb-nav__group:focus-within .sb-nav__dropdown { display: block; }
.sb-nav__dropdown a { display: block; padding: 8px 10px; border-radius: 6px; font-size: 14px; }
.sb-nav__dropdown a:hover { background: var(--sb-surface-hi); }
.sb-tag-soon { background: var(--sb-accent); color: #1A1208; font-size: 10px; padding: 2px 6px; border-radius: 4px; margin-left: 6px; font-weight: 700; letter-spacing: 0; }
.sb-lang { display: flex; gap: 4px; align-items: center; }
.sb-lang a { font-size: 13px; padding: 4px 8px; border-radius: 4px; }
.sb-lang a[aria-current="true"] { background: var(--sb-surface-hi); color: var(--sb-primary); }
.sb-header__cta { display: flex; gap: 8px; align-items: center; }
.sb-mobile-toggle { display: inline-flex; min-height: 44px; align-items: center; background: none; border: 1px solid var(--sb-border-hi); padding: 8px 10px; border-radius: 6px; color: var(--sb-text); cursor: pointer; }

.sb-footer {
  background: var(--sb-bg-alt);
  border-top: 1px solid var(--sb-border);
  color: var(--sb-text-muted);
  padding: 64px 0 32px;
  font-size: 14px;
}
.sb-footer__cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.sb-footer h4 { color: var(--sb-text); font-size: 15px; margin-bottom: 14px; }
.sb-footer a { color: var(--sb-text-muted); display: block; padding: 4px 0; }
.sb-footer a:hover { color: var(--sb-primary); }
.sb-footer__bottom { border-top: 1px solid var(--sb-border); margin-top: 40px; padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; }

/* ----- 10. Floating contact & WeChat modal ----- */
.sb-floating {
  position: fixed; right: 18px; bottom: 18px; z-index: 95;
  display: flex; flex-direction: column; gap: 10px;
}
.sb-floating__btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--sb-primary); color: #04161A;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--sb-shadow);
  cursor: pointer; border: none;
  font-size: 22px;
  transition: transform .2s ease;
}
.sb-floating__btn:hover { transform: scale(1.06); }
.sb-floating__btn--wa { background: #25D366; }
.sb-floating__btn--wc { background: #07C160; color: #fff; }
.sb-floating__btn--top { background: var(--sb-surface-hi); color: var(--sb-text); border: 1px solid var(--sb-border-hi); }

.sb-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.sb-modal[data-open="true"] { display: flex; }
.sb-modal__panel {
  background: var(--sb-surface); border-radius: var(--sb-radius);
  padding: 32px; max-width: 360px; text-align: center;
  border: 1px solid var(--sb-border);
}
.sb-modal__panel img { margin: 0 auto 16px; max-width: 220px; }
.sb-modal__close { background: var(--sb-surface-hi); border: 1px solid var(--sb-border-hi); color: var(--sb-text); padding: 8px 18px; border-radius: 999px; cursor: pointer; margin-top: 12px; }

/* ----- 11. Form ----- */
.sb-contact-form { display: grid; gap: 16px; max-width: 640px; }
.sb-contact-form label { display: block; font-size: 14px; color: var(--sb-text); margin-bottom: 6px; font-weight: 500; }
.sb-contact-form input,
.sb-contact-form textarea,
.sb-contact-form select {
  width: 100%;
  background: var(--sb-surface);
  border: 1px solid var(--sb-border-hi);
  border-radius: var(--sb-radius-sm);
  padding: 12px 14px;
  color: var(--sb-text);
  font-family: var(--sb-font);
  font-size: 15px;
  transition: border-color .2s ease;
}
.sb-contact-form input:focus,
.sb-contact-form textarea:focus,
.sb-contact-form select:focus { outline: none; border-color: var(--sb-primary); }
.sb-contact-form textarea { min-height: 140px; resize: vertical; }
.sb-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ----- 12. Misc ----- */
.sb-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--sb-surface-hi); color: var(--sb-text-muted); font-size: 12px; margin: 0 4px 4px 0; border: 1px solid var(--sb-border); }
.sb-divider { height: 1px; background: var(--sb-border); margin: 40px 0; }
.sb-quote {
  border-left: 3px solid var(--sb-primary);
  padding: 8px 0 8px 20px;
  font-size: 18px;
  color: var(--sb-text);
  font-style: italic;
}
.sb-list-check { list-style: none; padding-left: 0; }
.sb-list-check li { position: relative; padding-left: 28px; margin-bottom: 10px; }
.sb-list-check li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--sb-primary); font-weight: 700; }

/* ==========================================================================
   14. Vibe Motion — Vanilla JS-driven, China-safe, no external dependency
   所有進場動效預設以 .sb-reveal hook 控制，由 starbay-global.js 控制。
   只要加 .no-anim 到 <body> 或任何容器即可關閉所有動效。
   未啟用 JS（或 JS 失敗）時，內容仍完整可見（fallback 見下方）。
   ========================================================================== */

/* 進場揭露 scroll reveal：JS 就緒時才隱藏，無 JS 不隱藏 */
.sb-reveal { will-change: opacity, transform; }
html.sb-js-ready .sb-reveal {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity .7s var(--sb-ease), transform .7s var(--sb-ease);
}
html.sb-js-ready .sb-reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* stagger 順序由 JS 加 inline transition-delay，這裡提供預設 */

/* 統計數字 counter */
.sb-stat { text-align: center; }
.sb-stat__num {
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
  background: linear-gradient(120deg, var(--sb-accent) 0%, var(--sb-cyan) 60%, var(--sb-gold) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.sb-stat__label { color: var(--sb-text-muted); font-size: 14px; margin-top: 8px; }
.sb-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }

/* Hero 視差 parallax（微量，JS 設定 translateY） */
.sb-parallax { will-change: transform; }

/* 磁吸 CTA magnetic（非常微妙，JS 控制 transform） */
.sb-magnetic { transition: transform .3s var(--sb-ease); }

/* gallery swipe 提示光標（手機） */
@media (hover: none) and (pointer: coarse) {
  .sb-gallery { scroll-snap-type: x mandatory; }
}

/* === 動效總開關：.no-anim 或 prefers-reduced-motion === */
.no-anim .sb-reveal,
.no-anim .sb-parallax,
.no-anim .sb-magnetic {
  opacity: 1 !important;        /* 原因：關閉動效時必須強制顯示內容 */
  transform: none !important;   /* 原因：避免殘留位移狀態 */
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  html.sb-js-ready .sb-reveal {
    opacity: 1 !important;       /* 原因：尊重使用者減動效偏好 */
    transform: none !important;
    transition: none !important;
  }
  .sb-parallax, .sb-magnetic { transform: none !important; }
  .sb-motion-bg::before, .sb-motion-bg::after { animation: none !important; }
}

/* ----- 13. Responsive ----- */
/* mobile first base */
.sb-footer__cols { grid-template-columns: 1fr; }
.sb-form-row { grid-template-columns: 1fr; }
.sb-header__inner { padding: 10px 18px; gap: 12px; }
.sb-header__cta .sb-btn { padding: 9px 12px; font-size: 13px; }
.sb-header__cta .sb-lang { display: none; }
.sb-floating { right: 12px; bottom: 78px; }
.sb-floating__btn { width: 46px; height: 46px; }
/* 手機：有表單的頁面下方預留空間，避免浮動按鈕遮住送出鈕。
   用法：<body class="sb-has-form"> 或 contact 頁模板自動加。 */
.sb-has-form .sb-contact-form { padding-bottom: 84px; }
.sb-has-form .sb-floating { bottom: 14px; }
@media (max-width: 767px) {
  .sb-table,
  .sb-table thead,
  .sb-table tbody,
  .sb-table th,
  .sb-table td,
  .sb-table tr { display: block; min-width: 0; }
  .sb-table { min-width: 0; }
  .sb-table thead { display: none; }
  .sb-table tr { border-bottom: 1px solid var(--sb-border); padding: 10px 0; }
  .sb-table td { border-bottom: 0; padding: 8px 14px; }
  .sb-table td:first-child {
    color: var(--sb-primary);
    font-weight: 700;
  }
}

/* >= 640px */
@media (min-width: 640px) {
  :root {
    --sb-fs-hero: 40px;
    --sb-fs-h1: 34px;
    --sb-fs-h2: 28px;
  }
  .sb-container { padding: 0 24px; }
  .sb-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sb-gallery { grid-auto-columns: minmax(320px, 48%); }
}

/* >= 768px */
@media (min-width: 768px) {
  :root {
    --sb-fs-hero: 48px;
    --sb-fs-h1: 40px;
    --sb-fs-h2: 32px;
  }
  .sb-hero { padding: 104px 0 82px; }
  .sb-hero__inner { grid-template-columns: minmax(0, .95fr) minmax(280px, .72fr); }
  .sb-hero__image--desktop { display: block; }
  .sb-hero__image--mobile { display: none; }
  .sb-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sb-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sb-media-copy { grid-template-columns: minmax(0, 1fr) minmax(280px, .72fr); }
  .sb-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sb-header__cta .sb-lang { display: flex; }
  .sb-floating { bottom: 18px; }
  .sb-stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* >= 1024px */
@media (min-width: 1024px) {
  :root {
    --sb-fs-hero: 56px;
  }
  .sb-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sb-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sb-gallery {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow-x: visible;
  }
  .sb-footer__cols { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .sb-mobile-toggle { display: none; }
  .sb-nav {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 22px;
    padding: 0;
    border: 0;
    background: transparent;
  }
  .sb-nav a { width: auto; min-height: 44px; padding: 0; }
  .sb-nav__dropdown {
    position: absolute;
    top: 100%;
    left: -16px;
    background: var(--sb-surface);
    border: 1px solid var(--sb-border);
    padding: 14px;
    min-width: 240px;
    display: none;
    box-shadow: var(--sb-shadow);
  }
  .sb-nav__dropdown a { display: block; min-height: 0; padding: 8px 10px; width: 100%; }
}

/* >= 1280px */
@media (min-width: 1280px) {
  :root {
    --sb-fs-hero: 62px;
  }
  .sb-hero { padding: 132px 0 104px; }
}

/* Print friendliness for proposals */
@media print {
  .sb-floating, .sb-header, .sb-footer, .sb-cta-band { display: none !important; }
  .sb-page { background: #fff; color: #111; }
  .sb-page * { color: #111 !important; background: #fff !important; }
}
