/* ==========================================================================
   WalkLife AI Lab — 全站共用標頭 v3（多層選單）2026-11-29
   自成一套：不依賴 site.css，quiz 等有自己樣式的頁面也能直接套用。
   所有規則都以 .wl3-header 開頭，避免被各頁自己的 a{} / button{} 樣式蓋掉。
   搭配 /assets/nav-v3.js（漢堡按鈕＋下拉選單）。
   ========================================================================== */

.wl3-header{
  --h-ink:#111827; --h-yellow:#FFDC55; --h-blue:#1F5BE0; --h-cream:#fff7df;
  position:sticky; top:0; z-index:1000;
  background:var(--h-yellow); border-bottom:4px solid var(--h-ink);
  font-family:"Noto Sans TC","Microsoft JhengHei",-apple-system,BlinkMacSystemFont,sans-serif;
  font-size:16px; line-height:1.4; color:var(--h-ink); text-align:left;
}
.wl3-header *,.wl3-header *::before,.wl3-header *::after{box-sizing:border-box;}
.wl3-header .wl3-inner{max-width:1240px; margin:0 auto; padding:10px 18px; display:flex; align-items:center; justify-content:space-between; gap:16px;}

/* Logo */
.wl3-header a.wl3-logo{display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--h-ink); white-space:nowrap;}
.wl3-header .wl3-logo img{width:42px; height:42px; border-radius:10px; border:3px solid var(--h-ink); box-shadow:3px 3px 0 var(--h-ink); display:block; background:var(--h-blue);}
.wl3-header .wl3-logo b{display:block; font-size:18px; font-weight:900; letter-spacing:.01em;}
.wl3-header .wl3-logo small{display:block; font-size:11px; font-weight:700; color:#4a3d00; letter-spacing:.06em;}

/* Nav */
.wl3-header .wl3-nav{display:flex; align-items:center; gap:2px; margin:0; padding:0;}
.wl3-header .wl3-item{position:relative;}
.wl3-header .wl3-top{
  font:inherit; font-weight:900; font-size:15px; color:var(--h-ink); background:none; cursor:pointer; margin:0;
  padding:8px 13px; border-radius:999px; border:3px solid transparent; text-decoration:none; white-space:nowrap;
  display:inline-flex; align-items:center; gap:5px; line-height:1.3; box-shadow:none; transition:background .15s,border-color .15s;
}
.wl3-header .wl3-top:hover,.wl3-header .wl3-item.wl3-open > .wl3-top{border-color:var(--h-ink); background:#fff;}
.wl3-header .wl3-caret{width:0; height:0; border-left:4px solid transparent; border-right:4px solid transparent; border-top:5px solid currentColor; transition:transform .15s;}
.wl3-header .wl3-item.wl3-open .wl3-caret{transform:rotate(180deg);}
.wl3-header a.wl3-cta{
  margin-left:8px; text-decoration:none; font-weight:900; font-size:14.5px; white-space:nowrap;
  background:var(--h-ink); color:var(--h-yellow); border:3px solid var(--h-ink); border-radius:999px; padding:9px 18px;
}
.wl3-header a.wl3-cta:hover{background:#333; color:var(--h-yellow);}

/* Mega dropdown */
.wl3-header .wl3-mega{
  position:absolute; top:calc(100% + 10px); left:50%; transform:translateX(-50%);
  background:#fff; border:3px solid var(--h-ink); border-radius:16px; box-shadow:7px 7px 0 var(--h-ink);
  padding:16px; display:none; gap:16px; z-index:1001;
}
.wl3-header .wl3-mega::before{content:""; position:absolute; left:0; right:0; top:-16px; height:16px;}
.wl3-header .wl3-item.wl3-open > .wl3-mega{display:grid;}
.wl3-header .wl3-mega.c2{grid-template-columns:repeat(2,minmax(250px,1fr)); width:620px;}
.wl3-header .wl3-mega.c1{grid-template-columns:minmax(260px,1fr); width:330px;}
.wl3-header .wl3-mega h4{margin:0 0 6px; font-size:11px; letter-spacing:.08em; color:#7a6a20; font-weight:900; border-bottom:2px dashed #e6d9a6; padding-bottom:6px;}
.wl3-header .wl3-mega a{
  display:flex; gap:10px; align-items:flex-start; padding:8px 10px; border-radius:10px; border:2px solid transparent;
  text-decoration:none; color:var(--h-ink); font-size:14px; font-weight:800; line-height:1.35; background:none;
}
.wl3-header .wl3-mega a:hover{background:var(--h-cream); border-color:var(--h-ink); color:var(--h-ink);}
.wl3-header .wl3-mega .mi{font-size:18px; flex:none; line-height:1.2;}
.wl3-header .wl3-mega small{display:block; font-weight:600; color:#666; font-size:12px; margin-top:2px;}
.wl3-header .wl3-badge{display:inline-block; font-size:10px; font-weight:900; padding:1px 7px; border-radius:99px; border:2px solid var(--h-ink); background:var(--h-yellow); margin-left:4px; vertical-align:1px;}
.wl3-header .wl3-badge.free{background:#b9f2c9;}
.wl3-header .wl3-chapters{display:grid; grid-template-columns:1fr 1fr; gap:0 6px;}
.wl3-header .wl3-mega .wl3-chapters a{padding:5px 8px; font-size:13px; font-weight:700; white-space:nowrap;}

/* Burger */
.wl3-header .wl3-burger{display:none; width:44px; height:44px; border:3px solid var(--h-ink); border-radius:12px; background:#fff; cursor:pointer; padding:0; margin:0; position:relative; flex:none;}
.wl3-header .wl3-burger i,.wl3-header .wl3-burger i::before,.wl3-header .wl3-burger i::after{content:""; position:absolute; height:3px; background:var(--h-ink); border-radius:2px; display:block;}
.wl3-header .wl3-burger i{left:10px; right:10px; top:18px;}
.wl3-header .wl3-burger i::before{left:0; right:0; top:-7px;}
.wl3-header .wl3-burger i::after{left:0; right:0; top:7px;}

@media (max-width:1080px){
  .wl3-header .wl3-top{padding:8px 9px; font-size:14px;}
  .wl3-header a.wl3-cta{padding:8px 12px; font-size:13.5px;}
}
@media (max-width:920px){
  .wl3-header .wl3-burger{display:block;}
  .wl3-header .wl3-nav{
    position:fixed; left:0; right:0; top:var(--wl3-top,66px); background:var(--h-yellow); border-bottom:4px solid var(--h-ink);
    flex-direction:column; align-items:stretch; padding:10px 16px 18px; gap:6px;
    max-height:calc(100vh - var(--wl3-top,66px)); overflow-y:auto;
    transform:translateY(-130%); visibility:hidden; transition:transform .2s ease,visibility .2s;
    box-shadow:0 8px 0 rgba(0,0,0,.12);
  }
  .wl3-header .wl3-nav.wl3-show{transform:translateY(0); visibility:visible;}
  .wl3-header .wl3-top{width:100%; justify-content:space-between; padding:12px 14px; background:#fff; border-color:var(--h-ink); border-radius:12px; font-size:15px;}
  .wl3-header a.wl3-cta{margin:4px 0 0; text-align:center; padding:12px;}
  .wl3-header .wl3-mega,.wl3-header .wl3-mega.c2,.wl3-header .wl3-mega.c1{position:static; transform:none; width:auto; box-shadow:none; grid-template-columns:1fr; margin-top:6px; padding:12px; border-radius:12px;}
  .wl3-header .wl3-mega::before{display:none;}
}
@media (max-width:420px){
  .wl3-header .wl3-logo small{display:none;}
}
