:root { --brand:#0b4f8a; --bg:#f5f7fa; --line:#dde3ea; --text:#222; }
* { box-sizing:border-box; }
body { margin:0; font-family:"Noto Sans TC","Microsoft JhengHei",sans-serif; color:var(--text); background:var(--bg); }
a { color:var(--brand); text-decoration:none; }

/* ===== 上方下拉選單 ===== */
.topbar { position:sticky; top:0; z-index:100; display:flex; align-items:center; gap:24px;
  padding:0 24px; height:64px; background:#fff; border-bottom:1px solid var(--line); }
.logo { font-weight:700; font-size:20px; }
.topnav { flex:1; }
.topnav > ul { display:flex; list-style:none; margin:0; padding:0; }
.topnav li { position:relative; }
.topnav > ul > li > a { display:block; padding:0 18px; line-height:64px; color:var(--text); }
.topnav > ul > li.active > a, .topnav > ul > li:hover > a { color:var(--brand); box-shadow:inset 0 -3px var(--brand); }
.topnav .sub { display:none; position:absolute; top:64px; left:0; min-width:180px; list-style:none;
  margin:0; padding:6px 0; background:#fff; border:1px solid var(--line); box-shadow:0 6px 16px rgba(0,0,0,.08); }
.topnav li:hover > .sub, .topnav li:focus-within > .sub { display:block; }
.topnav .sub a { display:block; padding:10px 16px; color:var(--text); }
.topnav .sub a:hover { background:var(--bg); color:var(--brand); }
.nav-toggle { display:none; margin-left:auto; font-size:22px; background:none; border:0; }

/* ===== 左側跟隨選單 ===== */
.layout { display:grid; grid-template-columns:220px 1fr; gap:32px; max-width:1200px; margin:32px auto; padding:0 24px; }
.sidenav { position:sticky; top:88px; align-self:start; background:#fff; border:1px solid var(--line); }
.sidenav h2 { margin:0; padding:14px 16px; font-size:17px; color:#fff; background:var(--brand); }
.sidenav ul { list-style:none; margin:0; padding:0; }
.sidenav a { display:block; padding:12px 16px; border-top:1px solid var(--line); color:var(--text); }
.sidenav a:hover, .sidenav a.current { color:var(--brand); background:var(--bg); border-left:4px solid var(--brand); padding-left:12px; }
.content { background:#fff; border:1px solid var(--line); padding:28px; min-height:60vh; }
.content section { scroll-margin-top:88px; }  /* 點錨點時不被上方選單蓋住 */
.footer { text-align:center; padding:24px; color:#666; font-size:14px; }

/* ===== 手機版 ===== */
@media (max-width:820px) {
  .nav-toggle { display:block; }
  .topnav { display:none; position:absolute; top:64px; left:0; right:0; background:#fff; border-bottom:1px solid var(--line); }
  .topnav.open { display:block; }
  .topnav > ul { flex-direction:column; }
  .topnav > ul > li > a { line-height:48px; }
  .topnav .sub { position:static; display:block; border:0; box-shadow:none; padding-left:16px; }
  .lang { display:none; }
  .layout { grid-template-columns:1fr; }
  .sidenav { position:static; }
}

/* 頂端選單與下方內容區左右對齊（螢幕寬度超過 1200px 時） */
.topbar {
  padding-left: max(24px, calc((100% - 1200px) / 2 + 24px));
  padding-right: max(24px, calc((100% - 1200px) / 2 + 24px));
}

/* ===== 回到頂端按鈕 ===== */
#back-top { position:fixed; right:16px; bottom:16px; width:46px; height:46px; padding:0; border:0; border-radius:4px; background:#333 url(/index_files/vecteezy_arrow-3d_top.png) center / 46px 46px no-repeat; cursor:pointer; z-index:9000; opacity:0; visibility:hidden; transition:opacity .3s, visibility .3s; }
#back-top.show { opacity:.85; visibility:visible; }
#back-top:hover, #back-top:focus-visible { opacity:1; }

/* ===== 頁首：第一行商標與公司名稱、第二行選單 ===== */
.brandbar { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:10px max(24px, calc((100% - 1200px) / 2 + 24px)); background:#fff; }
.brand { display:block; min-width:0; line-height:0; }
.brand img { display:block; max-width:100%; height:auto; }
.brandbar .lang { flex:none; font-size:14px; font-weight:700; }
@media (min-width:821px) { .topnav > ul { margin-left:-18px; } }
@media (max-width:820px) { .brandbar { padding:8px 16px; } .brandbar .lang { display:block; } }

/* 頁首置中：商標置中、選單置中，EN 固定在右側 */
.brandbar { position:relative; justify-content:center; }
.brandbar .lang { position:absolute; top:50%; right:max(24px, calc((100% - 1200px) / 2 + 24px)); transform:translateY(-50%); }
@media (min-width:821px) { .topnav > ul { justify-content:center; margin-left:0; } }
@media (max-width:820px) {
  .brandbar { justify-content:space-between; }
  .brandbar .lang { position:static; transform:none; }
}

/* 上方下拉選單：滑鼠移過去時左邊出現直槓（和左側選單一致） */
.topnav .sub a { border-left:4px solid transparent; padding-left:12px; }
.topnav .sub a:hover, .topnav .sub a:focus-visible { border-left-color:var(--brand); }

/* 點頁內導覽跳到標題時，不被上方固定選單蓋住 */
.content h2 { scroll-margin-top: 88px; }

/* ===== 禁止複製（線上服務頁除外；該頁只擋下方 QR 圖）===== */
body.no-copy { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.no-copy input, body.no-copy textarea { -webkit-user-select: text; user-select: text; }
body.no-copy img, .jy-qr img { pointer-events: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }

/* ===== 閒置逾時提示 ===== */
.jy-idle { position:fixed; inset:0; z-index:99999; display:flex; align-items:center; justify-content:center; background:rgba(245,247,250,.92); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); }
.jy-idle-box { max-width:380px; margin:16px; padding:24px; background:#fff; border:1px solid #dde3ea; border-radius:6px; text-align:center; box-shadow:0 8px 24px rgba(0,0,0,.12); }
.jy-idle-box h2 { margin:0 0 10px; font-size:1.15rem; }
.jy-idle-box p { margin:0 0 16px; line-height:1.7; }
.jy-idle-box button { padding:8px 24px; border:0; border-radius:4px; background:var(--brand); color:#fff; font:inherit; cursor:pointer; }
/* 計數器 */
.footer .visitors { margin:4px 0 0; }
.jy-banner{display:block;margin-left:auto;margin-right:auto;max-width:100%;height:auto;}
.layout{margin-top:12px;}
.content{padding-top:16px;}
.content h1{margin-top:0;}
@media (max-width:820px) {
  .nav-toggle { font-size:36px; line-height:1; min-width:56px; min-height:56px; padding:8px 14px; cursor:pointer; color:#25508a; }
}
/* 手機選單：沒按藍色、按下紅色；選單太長時可在選單內上下捲動 */
@media (max-width:820px) {
  .nav-toggle { color:#25508a; }
  .nav-toggle[aria-expanded="true"] { color:#d32f2f; }
  .topnav.open { max-height:70vh; max-height:70dvh; overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; }
}
@media (max-width:820px) {
  .topnav.open { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
}

/* ===== 站內搜尋（放大鏡 + 輸入框 + 結果清單）===== */
.nav-search-btn { position:absolute; top:10px; right:max(24px, calc((100% - 1200px) / 2 + 24px)); width:44px; height:44px; padding:0; border:0; border-radius:4px; background:none; color:var(--brand); cursor:pointer; display:flex; align-items:center; justify-content:center; }
.nav-search-btn:hover, .nav-search-btn[aria-expanded="true"] { background:var(--bg); }
.nav-search-btn svg { width:22px; height:22px; }
.site-search { position:absolute; top:64px; right:max(24px, calc((100% - 1200px) / 2 + 24px)); width:min(420px, calc(100% - 32px)); padding:12px; background:#fff; border:1px solid var(--line); box-shadow:0 6px 16px rgba(0,0,0,.12); z-index:110; }
.site-search[hidden] { display:none; }
.site-search input { display:block; width:100%; box-sizing:border-box; padding:10px 12px; font:inherit; font-size:16px; border:1px solid #c9d2dc; border-radius:4px; background:#fff; }
.site-search input:focus { outline:2px solid rgba(11,79,138,.25); border-color:var(--brand); }
.site-search ul { list-style:none; margin:8px 0 0; padding:0; max-height:50vh; overflow-y:auto; }
.site-search li a { display:block; padding:10px 8px; border-top:1px solid var(--line); color:var(--text); }
.site-search li.on a, .site-search li a:hover { background:var(--bg); color:var(--brand); }
.site-search li small { display:block; margin-top:2px; color:#666; font-size:13px; line-height:1.4; }
.site-search li.none { padding:10px 8px; color:#666; }
@media (max-width:820px) {
  .nav-search-btn { position:static; order:-1; margin-left:auto; width:48px; height:48px; }
  .nav-toggle { margin-left:0; }
  .site-search { left:16px; right:16px; width:auto; }
}
