/* 全站共用：色彩、字體、頁首、語系切換 */
:root {
  --paper: #F7F9FA;
  --surface: #FFFFFF;
  --stage: #EDF1F3;
  --ink: #142430;
  --ink-2: #4A5A66;
  --muted: #7C8A95;
  --line: #E3E8EC;
  --brand: #128ABE;
  --brand-deep: #1962A3;   /* 主色：與 FMS 機器人平台一致 */
  --brand-press: #134C80;  /* 主色加深：滑過、按下 */
  --brand-ink: #123F6B;    /* 大面積深色區塊 */
  --wash: #E9F0FA;
  --ok: #1F9D63;
  --angus: #128ABE;
  --dali: #1F9D63;
  --annie: #E5813A;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --cjk: "Noto Sans TC";
  --en: "Roboto", var(--cjk), system-ui, sans-serif;
  --zh: var(--en);
  --head-h: 64px;
  color-scheme: light;
}
html[lang="ja"] { --cjk: "Noto Sans JP"; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--en); font-size: 15px; line-height: 1.7;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------- 頁首 ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  height: var(--head-h); display: flex; align-items: center; gap: 40px;
  padding: 0 28px; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand .mark { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-deep); color: #fff; }
.brand .mark svg { width: 18px; height: 18px; }
.brand b { font-size: 16px; font-weight: 500; letter-spacing: .01em; }
.brand-name { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name small { font-size: 11px; color: var(--muted); letter-spacing: .03em; }
.brand-name small:empty { display: none; }
.site-nav { display: flex; gap: 4px; flex: 1; }
.site-nav a {
  position: relative; text-decoration: none; font-size: 14px; color: var(--ink-2);
  padding: 8px 12px; border-radius: 8px; transition: color .2s, background .2s;
}
.site-nav a:hover { color: var(--brand-deep); background: var(--paper); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.site-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -13px; height: 2px; background: var(--brand-deep); border-radius: 2px;
}
.head-cta {
  flex: none; text-decoration: none; font-size: 14px; font-weight: 500; color: var(--brand-deep);
  padding: 8px 14px; border-radius: 8px; box-shadow: inset 0 0 0 1px #BCD0EA; transition: background .2s;
}
.head-cta:hover { background: var(--wash); }
.lang { flex: none; display: flex; padding: 3px; border-radius: 10px; background: var(--paper); }
.lang button {
  min-width: 36px; padding: 4px 8px; border-radius: 7px; font: 500 13px var(--en); color: var(--muted);
  transition: background .25s var(--ease), color .25s;
}
.lang button:hover { color: var(--ink); }
.lang button.on { background: var(--surface); color: var(--brand-deep); box-shadow: 0 1px 3px rgba(20,36,48,.12); }

@media (max-width: 980px) {
  .site-head { gap: 16px; padding: 0 16px; }
  .site-nav { overflow-x: auto; scrollbar-width: none; }
  .site-nav a { white-space: nowrap; padding: 8px 8px; }
  .head-cta { display: none; }
}
@media (max-width: 640px) {
  .brand-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- 可點擊元素的共用色票：白底＋細框線，滑過時框線轉品牌色 ---------- */
:root { --hit-line: #D3DFE7; --hit-hover: #93B4DA; }
:where(a, button):focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
.lang { box-shadow: inset 0 0 0 1px var(--hit-line); }

/* ---------- ORber 圖標：網頁主色深藍底、白色圖形（平台以軌道串起三台機器人） ---------- */
.brand .mark { --mark-bg: var(--brand-deep); width: 34px; height: 34px; border-radius: 9px; background: var(--mark-bg); }
.brand .mark svg { width: 24px; height: 24px; }

/* ---------- 載入畫面（物流情境、首頁主視覺共用）：小機器人沿進度條前進 ---------- */
.boot { display: grid; place-items: center; background: var(--paper); transition: opacity .7s var(--ease), visibility .7s; }
.boot.out { opacity: 0; visibility: hidden; }
.boot-in { width: min(440px, 76vw); display: flex; flex-direction: column; align-items: center; gap: 22px; }
.boot-track { position: relative; width: 100%; height: 6px; margin-top: 46px; border-radius: 99px; background: #DDE5EE; }
.boot-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--brand-deep); transform-origin: left center; transform: scaleX(0); }
.boot-bot { position: absolute; bottom: 9px; left: 0; width: 74px; height: auto; transform: translateX(-50%); animation: bootBob .42s ease-in-out infinite alternate; }
@keyframes bootBob { from { translate: 0 0; } to { translate: 0 -2px; } }
.boot-msg { margin: 0; min-height: 1.6em; font-size: 14px; color: var(--ink-2); letter-spacing: .02em; }
@media (prefers-reduced-motion: reduce) { .boot-bot { animation: none; } }

/* 「模擬這個情境」按鈕的播放圖示（首頁、導入規劃頁共用） */
.play-i { width: 1em; height: 1em; fill: currentColor; flex: none; }
.btn-play { display: inline-flex; align-items: center; gap: 7px; }

/* ============================================================
   手機版頁首（860px 以下）：圖標＋品牌名＋右上角漢堡按鈕；導覽與語系收進下拉選單（js/mobile-nav.js）
   ============================================================ */
.nav-toggle { display: none; }
@media (max-width: 860px) {
  :root { --head-h: 56px; }
  .site-head { gap: 12px; padding: 0 8px 0 16px; }
  .brand { flex: 1 1 0; min-width: 0; gap: 10px; }
  .brand .mark { width: 30px; height: 30px; border-radius: 8px; }
  .brand .mark svg { width: 21px; height: 21px; }
  .brand-name { display: flex; min-width: 0; overflow: hidden; }
  .brand b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-name small { display: none; }

  .nav-toggle { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; color: var(--ink); }
  .nav-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; overflow: visible; }
  .nav-toggle path { transform-box: view-box; transform-origin: 12px 12px; transition: transform .25s var(--ease), opacity .2s; }
  .menu-open .nav-toggle .l1 { transform: rotate(45deg) translateY(5px); }
  .menu-open .nav-toggle .l2 { opacity: 0; }
  .menu-open .nav-toggle .l3 { transform: rotate(-45deg) translateY(-5px); }

  /* 下拉選單：四個頁面一列一個，語系切換在最下方 */
  .site-nav, .lang { display: none; }
  .menu-open .site-nav {
    display: flex; flex-direction: column; gap: 2px; position: absolute; z-index: 1; top: 100%; left: 0; right: 0;
    padding: 8px 12px 70px; overflow: visible; background: var(--surface);
    border-bottom: 1px solid var(--line); box-shadow: 0 16px 32px rgba(20,36,48,.12);
  }
  .site-nav a { display: flex; align-items: center; height: 52px; padding: 0 14px; border-radius: 10px; font-size: 16px; white-space: nowrap; }
  .site-nav a:hover { background: var(--paper); }
  .site-nav a[aria-current="page"] { color: var(--brand-deep); background: var(--wash); }
  .site-nav a[aria-current="page"]::after { display: none; }
  .menu-open .lang { display: flex; position: absolute; z-index: 2; top: calc(100% + 236px); left: 24px; }
  .menu-open .lang button { min-width: 56px; padding: 6px 12px; font-size: 14px; }
  /* 選單下方暗色遮罩，點一下關閉 */
  .menu-open::after { content: ""; position: absolute; z-index: -1; top: 100%; left: 0; right: 0; height: 100vh; background: rgba(20,36,48,.32); }
}

/* 按鈕統一為圓角矩形（與頁首「專人諮詢服務」相同的 8px 圓角）；切換鈕外框 10px、內塊 7px */
:root { --btn-r: 8px; }
.head-cta { border-radius: var(--btn-r); }
