/* ============================================================
   無界｜X AI 設計系統
   所有色票由 :root 變數集中管理，主紫以 #5F1985 為核心色階
   ============================================================ */
:root {
    /* 基底色（白底、簡潔商業感） */
    --ub-bg: #ffffff;
    --ub-surface: #f8f5fa;
    --ub-surface-2: #efe7f4;
    --ub-border: #efe7f4;

    /* 主紫色階（以 #5F1985 為第 600 階錨點推導） */
    --ub-primary-50:  #f8f5fa;
    --ub-primary-100: #efe7f4;
    --ub-primary-200: #e0caed;
    --ub-primary-300: #cd9de7;
    --ub-primary-400: #b15ede;
    --ub-primary-500: #9026ca;
    --ub-primary-600: #5f1985;
    --ub-primary-700: #4a1269;
    --ub-primary-800: #390e51;
    --ub-primary-900: #2a0a3c;
    --ub-primary-950: #1b0626;

    --ub-primary: var(--ub-primary-600);
    --ub-primary-strong: var(--ub-primary-700);
    --ub-primary-soft: rgba(95, 25, 133, 0.10);

    /* 強調色（黃）：僅保留給 LINE 相關的重要 CTA，不可濫用 */
    --ub-accent: #ffc933;
    --ub-accent-strong: #e0a800;
    --ub-accent-ink: #2a2200;

    /* 文字（淺底） */
    --ub-text: #211a2e;
    --ub-text-dim: #5f5880;
    --ub-text-faint: #9a94b8;

    /* 深底（Hero / 結尾 CTA / Footer 共用同一套） */
    --ub-dark-1: #1b0626;
    --ub-dark-2: #2a0a3c;
    --ub-dark-text: #f6f2fb;
    --ub-dark-dim: #d9c2ea;
    --ub-dark-faint: #a98cc4;
    --ub-dark-border: rgba(255, 255, 255, 0.14);
    --ub-dark-card: #241033;

    /* 狀態色 */
    --ub-success: #14a36d;
    --ub-warning: #d98a00;
    --ub-danger: #e0355c;
    --ub-info: #1690d4;

    /* 圓角 / 陰影 / 字體 */
    --ub-radius: 16px;
    --ub-radius-sm: 10px;
    --ub-shadow: 0 4px 20px rgba(42, 10, 60, 0.08);
    --ub-font-display: "Noto Serif TC", "Songti TC", serif;
    --ub-font: "Noto Sans TC", -apple-system, "PingFang TC", "Segoe UI", sans-serif;

    /* fixed Header 佔用高度：桌面版不固定 Header，預設 0；手機斷點內覆寫 */
    --header-offset: 0px;
}

html { scroll-padding-top: var(--header-offset); }

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--ub-bg);
    color: var(--ub-text);
    font-family: var(--ub-font);
    -webkit-font-smoothing: antialiased;
    touch-action: manipulation;
}

body.ub-nav-open { overflow: hidden; }

a { color: var(--ub-primary); text-decoration: none; }
a:hover { color: var(--ub-primary-strong); }

h1, h2, h3 { font-family: var(--ub-font-display); }

/* ---- 卡片 ---- */
.ub-card {
    background: var(--ub-surface);
    border: 1px solid var(--ub-border);
    border-radius: var(--ub-radius);
    box-shadow: var(--ub-shadow);
}

/* ---- 按鈕 ---- */
.ub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 30px;
    border: none;
    border-radius: var(--ub-radius-sm);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--ub-font);
    cursor: pointer;
    transition: filter 0.15s, background 0.15s;
}
.ub-btn:active { filter: brightness(0.92); }

.ub-btn-primary { background: var(--ub-primary); color: #fff; }
.ub-btn-primary:hover { background: var(--ub-primary-strong); color: #fff; }
.ub-btn-accent  { background: var(--ub-accent); color: var(--ub-accent-ink); }
.ub-btn-accent:hover { background: var(--ub-accent-strong); color: var(--ub-accent-ink); }
.ub-btn-light   { background: #fff; color: var(--ub-primary-800); }
.ub-btn-light:hover { background: var(--ub-primary-50); color: var(--ub-primary-800); }
.ub-btn-ghost-dark {
    background: transparent; color: var(--ub-dark-text);
    border: 1px solid rgba(255, 255, 255, 0.28);
}
.ub-btn-ghost-dark:hover { background: rgba(255, 255, 255, 0.08); color: var(--ub-dark-text); }

/* ---- 標籤 chip ---- */
.ub-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--ub-border);
    color: var(--ub-primary-700);
    font-size: 14px;
    font-weight: 700;
}

/* ---- icon 徽章 ---- */
.ub-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--ub-surface);
    border: 1px solid var(--ub-border);
    color: var(--ub-primary);
}
.ub-icon-badge svg { width: 22px; height: 22px; }

/* ============================================================
   版面
   ============================================================ */
/* ---- Nav ---- */
.nav {
    position: relative;
    max-width: 1120px; margin: 0 auto;
    padding: 28px 40px 0;
    display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; flex-direction: column; line-height: 1.15; }
.brand .b1 { font-family: var(--ub-font-display); font-weight: 700; font-size: 19px; color: var(--ub-dark-text); }
.brand .b2 { font-weight: 700; font-size: 10px; letter-spacing: 2.5px; color: var(--ub-primary-300); }
.nav-right { display: flex; align-items: center; gap: 22px; }
/* .nav-glow 一律脫離文件流（手機版承接 Header 光暈用），避免它在桌機版也變成
   .nav 的第 3 個 flex 子項，把 justify-content:space-between 的兩端分配打亂、
   連帶把 .brand 往中間推——桌機版本來就只有 .brand／.nav-right 兩個子項。
   實際的裁切／光暈樣式（overflow:hidden、::after 圖形）留在手機版 media query。 */
.nav-glow { position: absolute; inset: 0; pointer-events: none; }
.nav .links { display: flex; gap: 32px; }
.nav .links a { font-size: 14px; font-weight: 700; color: var(--ub-dark-dim); }
.nav .links a:hover { color: var(--ub-dark-text); }

/* ---- 語言切換器 ---- */
.lang-switch { position: relative; }
.lang-switch-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 38px; padding: 0 10px; border-radius: 10px;
    border: 1px solid var(--ub-dark-border); background: transparent;
    color: var(--ub-dark-text); font-family: var(--ub-font); cursor: pointer;
}
.lang-switch-btn:hover { background: rgba(255, 255, 255, .06); }
.lang-switch-flag { width: 18px; height: 18px; border-radius: 50%; overflow: hidden; flex: none; display: inline-flex; }
.lang-switch-flag svg { width: 100%; height: 100%; display: block; }
.lang-switch-code { font-size: 13px; font-weight: 700; letter-spacing: .5px; }
.lang-switch-caret { flex: none; transition: transform .15s ease; }
.lang-switch.is-open .lang-switch-caret { transform: rotate(180deg); }
.lang-switch-menu {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; min-width: 190px;
    background: var(--ub-dark-2); border: 1px solid var(--ub-dark-border); border-radius: 12px;
    padding: 6px; box-shadow: 0 16px 40px rgba(17, 5, 26, .45);
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}
.lang-switch.is-open .lang-switch-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-switch-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 10px; border-radius: 8px; border: none; background: transparent;
    color: var(--ub-dark-dim); font-family: var(--ub-font); font-size: 14px; font-weight: 600;
    text-align: left; cursor: pointer; transition: background .12s, color .12s;
}
.lang-switch-item:hover { background: rgba(255, 255, 255, .08); color: var(--ub-dark-text); }
.lang-switch-item.is-active { background: var(--ub-primary-soft); color: var(--ub-dark-text); }
.lang-switch-item .lang-switch-flag { width: 20px; height: 20px; }

.burger {
    position: relative;
    width: 40px; height: 40px; border-radius: 10px;
    border: 1px solid var(--ub-dark-border);
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; cursor: pointer;
    color: var(--ub-dark-text);
}
.burger-bar {
    position: absolute; left: 50%; top: 50%; width: 18px; height: 2px;
    background: currentColor; border-radius: 2px;
    transform: translate(-50%, -50%);
    transition: transform 220ms ease-in-out, opacity 220ms ease-in-out;
}
.burger-bar-top { transform: translate(-50%, calc(-50% - 5px)); }
.burger-bar-bottom { transform: translate(-50%, calc(-50% + 5px)); }
.burger.is-open .burger-bar-top { transform: translate(-50%, -50%) rotate(45deg); }
.burger.is-open .burger-bar-mid { opacity: 0; }
.burger.is-open .burger-bar-bottom { transform: translate(-50%, -50%) rotate(-45deg); }
.nav .burger { display: none; }

/* ---- 手機版全螢幕選單（面板本身，不含 Header） ---- */
.mobile-menu {
    position: fixed; left: 0; right: 0; bottom: 0; top: 0; z-index: 90;
    background: linear-gradient(160deg, var(--ub-dark-1) 30%, var(--ub-dark-2) 100%);
    display: flex; flex-direction: column;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.mobile-menu .mm-links { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 32px; }
.mobile-menu .mm-links a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--ub-dark-text); font-family: var(--ub-font-display); font-size: 24px; font-weight: 700;
}
.mobile-menu .mm-links a:last-child { border-bottom: none; color: var(--ub-dark-text); }
.mobile-menu .mm-links a svg { color: var(--ub-primary-300); }
.mobile-menu .mm-foot { padding: 0 32px 48px; }

/* ---- Hero ---- */
.hero {
    position: relative; overflow: hidden;
    background: linear-gradient(160deg, var(--ub-dark-1) 30%, var(--ub-dark-2) 100%);
    padding-bottom: 96px;
}
.hero-glow {
    position: absolute; top: -220px; left: 50%; transform: translateX(-50%);
    width: 760px; height: 760px; border-radius: 50%;
    background: radial-gradient(circle, rgba(144, 38, 202, .35), transparent 65%);
    pointer-events: none;
}
.hero-content { position: relative; max-width: 720px; margin: 0 auto; padding: 96px 40px 0; text-align: center; }
.badge {
    display: inline-block; padding: 7px 18px; border-radius: 999px;
    border: 1px solid var(--ub-dark-border); background: rgba(255, 255, 255, .06);
    color: var(--ub-primary-300); font-size: 13px; font-weight: 700; letter-spacing: 1px;
    margin-bottom: 26px;
}
/* Hero 專屬的層級微調：badge 稍微往上、與主標題／敘述的間距重新拉齊節奏，
   不影響手機選單裡共用同一個 .badge 樣式的徽章 */
.hero-content .badge { margin-top: -8px; margin-bottom: 24px; }
.hero h1 {
    font-weight: 700; font-size: clamp(32px, 5.2vw, 54px); line-height: 1.35;
    color: var(--ub-dark-text); margin: 0 0 24px; letter-spacing: 1px;
    text-wrap: balance;
}
.hero h1 .accent { color: #d9a8f0; }
.hero-break { display: none; }
.hero .sub {
    font-size: clamp(14px, 2vw, 15px); line-height: 1.85; color: var(--ub-dark-dim);
    max-width: 560px; margin: 0 auto 34px;
}
/* 桌機版繁中副標的手動斷行點；手機沿用原本的自然換行，不受影響 */
.hero-sub-break { display: none; }
.hero .langs {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 36px;
}
.hero .langs .flag {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%; overflow: hidden;
    background: rgba(255, 255, 255, .06); border: 1px solid var(--ub-dark-border);
}
.hero .langs .flag svg { width: 100%; height: 100%; display: block; }
.hero .cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 0; }

/* ---- 對話示意（獨立成「LINE 群組實際樣貌」Section 後使用，
   改用實色深紫漸層卡片，不再依賴 Hero 深色背景才看得見） ---- */
.chat-demo {
    text-align: left; max-width: 460px; margin: 0 auto;
    background: linear-gradient(160deg, var(--ub-dark-1) 30%, var(--ub-dark-2) 100%);
    border: 1px solid var(--ub-dark-border);
    border-radius: 18px; padding: 22px 22px 20px;
    box-shadow: 0 24px 60px rgba(42, 10, 60, .18);
}
.chat-demo .title { font-size: 11px; font-weight: 800; color: var(--ub-dark-faint); letter-spacing: 2px; margin-bottom: 16px; }
.msg { display: flex; gap: 12px; margin-bottom: 16px; }
.msg:last-child { margin-bottom: 0; }
.msg .who {
    width: 34px; height: 34px; flex: none; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.msg .who svg { width: 100%; height: 100%; display: block; }
.msg .who.ai-avatar { background: #fff; }
.msg .who.ai-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg .bubble {
    background: var(--ub-dark-card); border: 1px solid var(--ub-dark-border);
    border-radius: 4px 16px 16px 16px; padding: 11px 15px;
}
.msg .bubble .txt { font-size: 14px; line-height: 1.7; color: var(--ub-dark-text); }
.msg .bubble .trans { font-size: 12.5px; color: var(--ub-dark-faint); margin-top: 4px; }
.mini-flag {
    display: inline-flex; width: 13px; height: 13px; border-radius: 50%; overflow: hidden;
    vertical-align: -2px; margin-right: 1px; flex: none;
}
.mini-flag svg { width: 100%; height: 100%; display: block; }

.msg-body { flex: 1; min-width: 0; }
.msg-name { font-size: 12px; font-weight: 800; color: var(--ub-dark-faint); margin: 0 0 5px 2px; }
.msg-ai .msg-name { color: var(--ub-primary-300); }

.ai-card {
    background: var(--ub-dark-card); border: 1px solid var(--ub-dark-border);
    border-radius: 4px 16px 16px 16px; padding: 13px 16px 14px;
}
.ai-quote {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px;
    padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--ub-dark-border);
}
.ai-quote-name { flex: none; font-size: 12px; font-weight: 800; color: var(--ub-dark-faint); }
.ai-quote-text { font-size: 13px; color: var(--ub-dark-dim); }
.ai-translations { display: flex; flex-direction: column; gap: 9px; }
.ai-trans-row {
    display: flex; align-items: flex-start; gap: 7px;
    font-size: 13.5px; line-height: 1.6; color: var(--ub-dark-text);
}
.ai-trans-row .mini-flag { margin-top: 3px; }

/* ---- 區塊共用 ---- */
.section { padding: 88px 40px; }
.section.alt { background: var(--ub-surface); }
.section .inner { max-width: 1120px; margin: 0 auto; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 3px; color: var(--ub-primary-500); margin-bottom: 10px; }
.section h2 { font-weight: 700; font-size: clamp(24px, 3.4vw, 32px); color: var(--ub-text); margin: 0 0 12px; }
.section h2 .accent { color: var(--ub-primary); }
.section .lead { color: var(--ub-text-dim); font-size: 15px; line-height: 1.9; max-width: 520px; margin: 0 0 0; }
.section-head { text-align: center; margin-bottom: 56px; }
.section-head .lead { margin: 0 auto; }

/* ---- 三步驟 ---- */
.steps-wrap { position: relative; }
.steps-line { position: absolute; top: 27px; left: 100px; right: 100px; height: 2px; background: var(--ub-border); }
.steps-circles { position: relative; display: flex; }
.steps-circles .col { width: 33.333%; text-align: center; }
.step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--ub-primary); color: #fff; font-weight: 900; font-size: 19px;
    font-family: var(--ub-font-display);
}
.steps-text { display: flex; gap: 40px; margin-top: 24px; }
.steps-text .col { width: 33.333%; text-align: center; }
.steps-text h3 { margin: 0 0 8px; font-size: 17px; color: var(--ub-text); }
.steps-text p {
    margin: 0 auto; max-width: 240px; color: var(--ub-text-dim); font-size: 14px; line-height: 1.8;
    text-wrap: balance;
}

.steps-mobile { display: none; }
.step-row { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.step-row:last-child { margin-bottom: 0; }
.step-row .step-num { width: 44px; height: 44px; font-size: 16px; flex: none; }
.step-row h3 { margin: 0 0 6px; font-size: 16px; color: var(--ub-text); }
.step-row p { margin: 0; color: var(--ub-text-dim); font-size: 14px; line-height: 1.8; }

/* ---- 六大核心功能：編輯式清單 ---- */
.features-wrap { display: flex; gap: 80px; align-items: stretch; }
.features-aside { width: 320px; flex: none; display: flex; flex-direction: column; }
.features-aside .lead { margin-top: 0; }
.features-visual {
    display: block; width: 100%; flex: 1 1 auto; min-height: 0;
    object-fit: cover; object-position: center; border-radius: 20px; margin-top: 40px;
}
.features-list { flex: 1; }
.feature-row {
    display: flex; gap: 20px; padding: 26px 0;
    border-bottom: 1px solid var(--ub-border);
}
.feature-row:last-child { border-bottom: none; padding-bottom: 0; }
.feature-row h3 { margin: 0 0 6px; font-size: 17px; color: var(--ub-text); }
.feature-row p { margin: 0; color: var(--ub-text-dim); font-size: 14px; line-height: 1.8; }

/* ---- 適用場景：實景照片卡 ---- */
.scenes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.scene-tile {
    position: relative; display: flex; flex-direction: column; justify-content: flex-end;
    border-radius: 20px; padding: 30px; min-height: 210px; color: #fff; overflow: hidden;
    background: var(--ub-primary-900);
}
.scene-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: 0; }
.scene-overlay {
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(to top, rgba(17, 5, 26, .82) 0%, rgba(17, 5, 26, .45) 42%, rgba(17, 5, 26, .05) 72%);
}
.scene-content { position: relative; z-index: 2; }
.scene-tile h3 { margin: 0 0 8px; font-size: 18px; color: #fff; }
/* 卡片文字是靠底部對齊的，敘述行數不同時整個文字區塊會跟著上下位移，六張卡片的標題／敘述
   就對不齊。這裡讓敘述區固定保留 --scene-desc-h（main.js 量測同一組卡片中最高的那則敘述後
   寫入）作為 content anchor：每張卡片的敘述區高度一致，標題與敘述的起始位置只由 anchor 決定，
   與各自實際行數無關；敘述本身仍可自然維持一行或多行。JS 未執行時退回原本的自然高度。 */
.scene-tile p { margin: 0; color: rgba(255, 255, 255, .88); font-size: 13.5px; line-height: 1.75; min-height: var(--scene-desc-h, 0px); }

/* ---- 適用場景：手機版 Carousel（桌面版隱藏） ---- */
.scenes-carousel { display: none; }
.carousel-track {
    display: flex; width: 100%; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
    scroll-behavior: smooth; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; -ms-overflow-style: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-page {
    flex: 0 0 100%; width: 100%; min-width: 0;
    scroll-snap-align: start; scroll-snap-stop: always;
    display: flex; flex-direction: column; gap: 16px;
}
.carousel-page .scene-tile { width: 100%; min-height: 0; aspect-ratio: 360 / 210; }
.carousel-nav { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 24px; }
.carousel-btn {
    width: 40px; height: 40px; flex: none; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ub-surface); border: 1px solid var(--ub-border); color: var(--ub-primary-700);
    cursor: pointer; transition: opacity .15s;
}
.carousel-dots { display: flex; align-items: center; gap: 8px; }
.carousel-dots .dot {
    width: 8px; height: 8px; padding: 0; border: none; border-radius: 999px;
    background: var(--ub-border); cursor: pointer; transition: width .2s, background .2s;
}
.carousel-dots .dot.is-active { width: 20px; background: var(--ub-primary); }

/* ---- 支援語言 ---- */
.lang-row { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; gap: 14px 16px; }
.lang-row .ub-chip { width: 212px; gap: 10px; }
.chip-flag { width: 20px; height: 20px; border-radius: 50%; overflow: hidden; flex: none; display: inline-flex; }
.chip-flag svg { width: 100%; height: 100%; display: block; }
.chip-label { flex: 1; text-align: center; }

/* ---- 結尾 CTA + Footer ---- */
.final-wrap {
    position: relative; overflow: hidden;
    background: linear-gradient(160deg, var(--ub-dark-1) 30%, var(--ub-dark-2) 100%);
}
.final-glow {
    position: absolute; top: -260px; left: 50%; transform: translateX(-50%);
    width: 700px; height: 700px; border-radius: 50%;
    background: radial-gradient(circle, rgba(144, 38, 202, .3), transparent 65%);
    pointer-events: none;
}
.final-cta { position: relative; max-width: 680px; margin: 0 auto; text-align: center; padding: 100px 40px 80px; }
.final-cta h2 { font-weight: 700; font-size: clamp(24px, 3.6vw, 34px); color: var(--ub-dark-text); margin: 0 0 14px; }
.final-cta h2 .accent { color: #d9a8f0; }
.final-cta p { color: var(--ub-dark-dim); font-size: 16px; line-height: 1.9; margin: 0 0 36px; }
.final-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px; }
.line-cta {
    display: inline-flex; align-items: center; gap: 14px;
    background: #fff; border: 1px solid var(--ub-primary-100); border-radius: 16px;
    padding: 10px 22px 10px 10px;
    box-shadow: 0 10px 28px rgba(27, 6, 38, .28);
    transition: transform 0.15s, box-shadow 0.15s;
}
.line-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(27, 6, 38, .38); color: inherit; }
.line-cta .qr { flex: none; width: 62px; height: 62px; border-radius: 8px; overflow: hidden; }
.line-cta .qr svg { display: block; width: 100%; height: 100%; }
.line-cta .txt { text-align: left; }
.line-cta .txt strong { display: block; font-size: 14.5px; font-weight: 800; color: var(--ub-primary-800); }
.line-cta .txt span { display: block; font-size: 12px; color: var(--ub-text-dim); margin-top: 3px; }

.footer-divider { position: relative; max-width: 1120px; margin: 0 auto; width: 100%; padding: 0 40px; }
.footer-divider .rule { border-top: 1px solid rgba(255, 255, 255, .12); }

.footer-grid {
    position: relative; max-width: 1120px; margin: 0 auto; width: 100%;
    padding: 56px 40px 0; display: flex; justify-content: space-between; gap: 60px;
}
.footer-grid .f-brand { max-width: 240px; }
.footer-grid .f-brand .b1 { font-family: var(--ub-font-display); font-weight: 700; font-size: 19px; color: var(--ub-dark-text); }
.footer-grid .f-brand .b2 { font-weight: 700; font-size: 10px; letter-spacing: 2.5px; color: var(--ub-primary-300); }
.footer-grid .f-brand p { margin: 14px 0 0; color: var(--ub-dark-faint); font-size: 13px; line-height: 1.8; }
.footer-grid .f-head { font-size: 12px; font-weight: 800; letter-spacing: 2px; color: var(--ub-primary-300); margin-bottom: 14px; }
.footer-grid .f-links { display: flex; flex-direction: column; gap: 10px; }
.footer-grid .f-links a { color: var(--ub-dark-faint); font-size: 14px; }
.footer-grid .f-links a:hover { color: var(--ub-dark-text); }
.footer-grid .f-contact { max-width: 260px; }
.footer-grid .f-contact p { margin: 0 0 6px; color: var(--ub-dark-dim); font-size: 14px; }
.footer-grid .f-contact p.dim { color: var(--ub-dark-faint); font-size: 13px; }
.footer-grid .f-contact a { color: var(--ub-dark-faint); }
.footer-grid .f-contact a:hover { color: var(--ub-dark-text); }

.footer-bottom {
    position: relative; max-width: 1120px; margin: 40px auto 0; width: 100%;
    padding: 32px 40px 32px; border-top: 1px solid rgba(255, 255, 255, .1);
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.footer-bottom span, .footer-bottom a { color: #8a72a3; font-size: 12.5px; }
.footer-bottom a:hover { color: var(--ub-dark-text); }

/* ============================================================
   響應式
   ============================================================ */
@media (max-width: 960px) {
    .scenes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    :root { --header-offset: 68px; }

    .nav .links { display: none; }
    .nav .burger { display: inline-flex; }
    .nav-right { gap: 14px; }
    .lang-switch-btn { height: 36px; padding: 0 8px; }
    .nav {
        position: fixed; top: 0; left: 0; right: 0; z-index: 100;
        max-width: none; margin: 0; padding: 14px 20px;
        background: var(--ub-dark-1);
        transition: background 0.2s ease;
    }
    /* 光暈裁切改放進獨立的 .nav-glow 容器自己做 overflow:hidden，不再讓 .nav 整體
       overflow:hidden——原本的寫法會連帶把語言切換器的下拉選單一起裁掉，因為
       下拉選單也是 .nav 的子孫元素，overflow 沒辦法只套用在其中一個子元素上。
       視覺效果（光暈同款同座標、選單打開時淡出）與修改前完全相同。 */
    .nav-glow { overflow: hidden; z-index: 0; }
    .nav-glow::after {
        content: "";
        position: absolute; top: -220px; left: 50%; transform: translateX(-50%);
        width: 760px; height: 760px; border-radius: 50%;
        background: radial-gradient(circle, rgba(144, 38, 202, .35), transparent 65%);
        transition: opacity 0.2s ease;
    }
    .nav > .brand, .nav > .nav-right { position: relative; z-index: 1; }
    /* menu overlay 的漸層在到達 30% 之前都是純色 --ub-dark-1（沒有中間過渡），
       所以打開選單時 Header 用同一個純色、並把光暈淡出，就會跟 overlay 頂部完全同色、無縫接軌。 */
    .nav.is-menu-open { background: var(--ub-dark-1); }
    .nav.is-menu-open .nav-glow::after { opacity: 0; }
    /* 整組 Hero 主內容（badge→標題→敘述→國旗→CTA）整體上移約 24px，
       只調整起始位置，不動任何內部元素間距 */
    .hero-content { padding: 108px 24px 0; }
    .mobile-menu { top: 68px; }
    /* Hero 原本沒有下限高度，純靠內容撐開，遇到實際可視範圍比內容高的手機
       （尤其工具列展開、LINE 內建瀏覽器等情況）就會在首屏底部露出下一個白色
       section。改用 min-height：100vh 是不支援新單位時的退回值；100svh
       （small viewport height）用瀏覽器工具列「完全展開」時最小的可視高度
       打底，確保首次進站、尚未捲動時一定被 Hero 蓋滿。

       這裡刻意不用 100dvh：dvh 會隨瀏覽器 UI 收合即時動態重算，LINE 內建
       瀏覽器往下滑動、頂部資訊列收起時，dvh 數值會跟著變大，min-height
       跟著即時變高，造成 Hero 紫色區塊在滑動過程中被「拉長」、首頁高度跳動
       ——這正是回報的異常現象的根本原因。svh 是依「UI 完全展開」算出的固定
       值，不會因為 UI 收合而重新計算，滑動全程高度穩定，同時仍能滿足「首次
       進站不露出下一區」的需求，兩個目標互不衝突。不影響內部元素排列，多出
       的空間只會落在 Hero 自己的深色背景範圍內，往下捲動仍可正常看到下一個
       section。

       但 svh／dvh 是近兩年才有的新單位，無法保證 LINE 內建瀏覽器等 WebView
       的引擎版本一定支援——不支援時整條宣告會被瀏覽器直接忽略，退回上一行的
       100vh，而 100vh 在部分行動瀏覽器引擎裡本身在工具列收合時就會重新計算，
       同樣可能重現「Hero 跟著被拉長」的問題。因此再疊一層與 CSS 單位完全無關
       的保險：scripts/main.js 會在載入當下用 window.innerHeight 鎖定一個
       固定 px 值寫進 --hero-vh，之後純捲動或工具列收合/展開都不會重新計算，
       只有真正裝置旋轉（寬度改變）才會重新量測。var() 第二參數 100svh 是
       JS 尚未執行前（或關閉 JS）的過渡退回值。 */
    .hero {
        min-height: 100vh;
        min-height: 100svh;
        min-height: var(--hero-vh, 100svh);
    }
}

@media (max-width: 760px) {
    .section { padding: 64px 24px; }
    .section-head { margin-bottom: 40px; }

    .hero .cta { flex-direction: row; flex-wrap: nowrap; gap: 10px; }
    .hero .cta .ub-btn { flex: 1 1 0; width: auto; padding-left: 10px; padding-right: 10px; white-space: nowrap; }
    /* 繁中之外的語言字串通常較長，強制不換行容易溢出按鈕，改用可換行 + 縮小字級與間距，避免破版 */
    html:not([lang="zh-TW"]) .hero .cta .ub-btn { white-space: normal; text-align: center; font-size: 13.5px; padding: 12px 8px; line-height: 1.3; }

    /* 手機版固定在語意點換行成「讓語言，不再是／團隊的界線」兩行，避免孤字掉到第二行 */
    .hero-break { display: block; }
    /* CTA 改並排釋放出的垂直空間，讓主標題可以再放大一點，維持兩行不變 */
    .hero h1 { font-size: 34px; }
    /* 敘述行距收緊約 4%，字級不變，只是行與行之間更俐落 */
    .hero .sub { line-height: 1.78; }

    .steps-line, .steps-circles, .steps-text { display: none; }
    .steps-mobile { display: block; }

    .features-wrap { flex-direction: column; gap: 36px; }
    .features-aside { width: 100%; }
    .features-visual { flex: none; width: 100%; max-width: 220px; aspect-ratio: 1 / 1; margin: 24px auto 0; }
    .feature-row { align-items: center; padding: 12px 0; gap: 14px; }
    .feature-row:last-child { padding-bottom: 12px; }
    .feature-row .ub-icon-badge { width: 36px; height: 36px; border-radius: 9px; }
    .feature-row .ub-icon-badge svg { width: 17px; height: 17px; }
    .feature-row h3 { margin: 0 0 3px; font-size: 15px; }
    .feature-row p { font-size: 13px; line-height: 1.6; }

    .final-actions { flex-direction: column; }
    .final-actions .ub-btn { width: 100%; max-width: 320px; }
    .final-actions .line-cta { width: 100%; max-width: 320px; justify-content: center; }
    .lang-row { grid-template-columns: 1fr; gap: 10px; }
    .lang-row .ub-chip { width: min(100%, 240px); justify-self: center; }

    .scenes-grid { display: none; }
    .scenes-carousel { display: block; }

    .footer-grid { flex-direction: column; gap: 20px; padding-top: 32px; }
    .f-nav { display: none; }
    .footer-bottom {
        flex-direction: row; flex-wrap: nowrap; align-items: center;
        justify-content: space-between; gap: 12px;
        margin-top: 20px; padding: 18px 24px;
    }
    .footer-bottom span, .footer-bottom a { font-size: 11.5px; white-space: nowrap; }
}

/* 桌機：Hero 以「一個完整首屏」為基準做垂直分配，用 min-height:100svh 讓內容在
   扣除 Header 後的空間內垂直置中。badge→內容區頂部（84px）與 CTA→內容區底部
   （80px，按鈕視覺較重故略收 4px）做光學等距，主標與其下 badge／副標／國旗／CTA
   的間距各自拉開層級，避免全部擠在中段。版型、順序、樣式都不變，只調整垂直定位。 */
@media (min-width: 861px) {
    .hero {
        min-height: 100vh;
        min-height: 100svh;
        display: flex;
        flex-direction: column;
        padding-bottom: 0;
    }
    /* .nav 靠 max-width + margin:0 auto 置中；成為 flex item 後 auto 邊距會讓它
       收縮成內容寬度，補回 width:100% 維持原本的 Header 排版 */
    .hero > .nav { width: 100%; flex: 0 0 auto; }
    .hero-content {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        /* 真正的 Hero 上下平衡要以 .hero 本身的邊界為準，不是 .hero-content 的
           padding box：Hero 頂部到 badge 之間還包含 nav（約 66px），下方 CTA 到
           Hero 底部卻沒有對應的區塊，兩者天生不對稱。要讓「Hero top→badge」與
           「CTA bottom→Hero bottom」視覺等距，必須讓 CTA→hero-content 底部的留白
           比 badge→hero-content 頂部的留白多出約一個 nav 高度（66px），
           因此 padding-bottom 比 padding-top 多 66px（112 - 46 = 66）。 */
        padding-top: 46px;
        padding-bottom: 112px;
    }
    /* badge 原為 inline-block，作為 flex item 會被拉伸滿版，維持置中不拉伸；
       桌機版整體縮小約 5% 並拉開與主標題的距離，維持短膠囊比例（位置與上一版完全相同，未變動） */
    .hero-content .badge {
        align-self: center;
        padding: 6.5px 17px; font-size: 12.5px;
        /* badge→主標間距 +8px（36→44），把主標往下推 8px；badge 自身位置不受影響
           （badge 在主標之前，主標的間距變動不會回頭移動 badge） */
        margin: 0 0 44px;
    }
    /* 主標往下移 8px，改由「badge→主標」間距 +8px、「主標→副標」間距 -8px 互相對沖
       （36→44，62→54，總和仍是 98px），兩段間距的總量不變，所以副標題／國旗／CTA
       的位置完全不受影響，也不需要動 padding-top 抵銷置中效應。 */
    .hero h1 { margin: 0 0 54px; filter: brightness(1.04); }
    /* 副標寬度收窄，避免與主標題等寬形成同一個大矩形；每個語言字寬差異大，
       不共用同一組寬度，改用 :lang() 各自設定最適合的 max-width，
       讓瀏覽器的預設貪婪換行（非 balance）自然產生「第一行略長、第二行略短」 */
    .hero .sub { font-size: 14.5px; line-height: 1.75; max-width: 680px; margin: 0 auto 31px; }
    html[lang="en"] .hero .sub { max-width: 790px; }
    html[lang="id"] .hero .sub { max-width: 755px; }
    html[lang="vi"] .hero .sub { max-width: 790px; }
    html[lang="th"] .hero .sub { max-width: 710px; }
    .hero-sub-break { display: block; }
    .hero .langs { gap: 13px; margin-bottom: 26px; }
    .hero .langs .flag { width: 36px; height: 36px; }
    .hero .cta { gap: 15px; margin-bottom: 0; }
    /* 主／次 CTA 尺寸微調：主按鈕更寬更高一點，次按鈕小幅跟進，兩者垂直高度一致 */
    .hero .cta .ub-btn-light { padding: 15px 33px; }
    .hero .cta .ub-btn-ghost-dark { padding: 15px 31px; }
}

/* 桌機／筆電：主標題強制單行，不要讓「線」單獨掉到第二行（僅限繁中版型；
   其他語言字數差異大，強制單行容易超出版面，改用 balance 自動換行） */
@media (min-width: 1280px) {
    .hero-content { max-width: 860px; }
    html[lang="zh-TW"] .hero h1 { white-space: nowrap; font-size: 64px; line-height: 1.14; }
    html:not([lang="zh-TW"]) .hero h1 { font-size: 46px; }
}
