/* ───────── 電腦版框架（≥768，index.html 用 media 只在這個寬度載入） ─────────
   斷點：<768 手機（不載這個檔）｜768～1199 平板：左邊 96px 窄導覽列、內容單欄放中間｜≥1200 電腦：左邊 244px 導覽列、內容多欄。
   做法：畫面（.scr）整個往右讓出導覽列的寬度；每個分頁自己畫的底部導航 .nav 藏起來，換成 shell.js 畫的常駐導覽 #side。
   每一頁怎麼排版在同一個資料夾自己的檔（home.css、read.css …）。顏色、字都用 tokens，不放新字型。 */
:root{--side:96px;--col:760px}
@media (min-width:1200px){:root{--side:244px;--col:1180px}}

/* 視窗就是 App：沒有手機框 */
html,body{background:var(--bg)}
body{display:block}
.stage{width:100%;height:100vh;height:100dvh;border-radius:0;border:0}

/* 常駐導覽 */
#side{position:absolute;left:0;top:0;bottom:0;width:var(--side);z-index:40;display:flex;flex-direction:column;padding:22px 12px 20px;background:var(--bg2);box-shadow:1px 0 0 rgba(255,255,255,.06)}
#side .side-brand{display:flex;align-items:center;gap:10px;height:44px;margin:0 6px 22px}
#side .side-brand svg{width:34px;height:34px;stroke:none}
#side .side-brand b{font:700 21px/1 var(--ui);letter-spacing:.06em}
#side .side-tabs{display:flex;flex-direction:column;gap:6px}
#side .side-tabs button{position:relative;display:flex;align-items:center;gap:14px;height:54px;padding:0 16px;border-radius:18px;font:500 17px/1 var(--ui);color:var(--sub);transition:background .15s,color .15s}
#side .side-tabs button:hover{background:rgba(255,255,255,.05);color:var(--ink)}
#side .side-tabs button:active{transform:none;background:rgba(255,255,255,.08)}
#side .side-tabs svg{width:30px;height:30px;filter:grayscale(1) brightness(.85);opacity:.55;transition:opacity .15s}
#side .side-tabs .on{background:var(--surface);color:var(--ink);font-weight:700}
#side .side-tabs .on svg{filter:none;opacity:1}
#side .side-tabs .on::before{content:"";position:absolute;left:-12px;top:14px;bottom:14px;width:4px;border-radius:0 4px 4px 0;background:var(--key)}
#side .side-tabs i{margin-left:auto;min-width:22px;height:22px;padding:0 6px;border-radius:11px;background:var(--bad);color:#fff;font:900 12px/22px var(--ui);font-style:normal;text-align:center}
#side button:focus-visible{outline:2px solid var(--key);outline-offset:2px}
/* 下面放兩個小數字：連續天數、金幣 */
#side .side-foot{margin-top:auto;display:flex;flex-direction:column;gap:8px}
#side .side-foot span{display:flex;align-items:center;gap:10px;height:44px;padding:0 16px;border-radius:16px;background:var(--surface)}
#side .side-foot svg{width:22px;height:22px}
#side .side-foot b{font:700 19px/1 var(--ui);font-variant-numeric:tabular-nums}
#side .side-foot small{margin-left:auto;font:500 13px/1 var(--ui);color:var(--sub)}

/* 整個蓋上來的畫面（作答、新手設定、發卡、專注計時）：導覽列收起來，畫面用滿 */
.stage.no-side{--side:0px}
.stage.no-side #side{display:none}

/* 畫面讓出導覽列；手機的底部導航不用了 */
.scr{left:var(--side)}
.nav{display:none}
#timer{left:calc(var(--side) + 20px)}
#timer.up{bottom:20px}
#timer.bar{left:var(--side)}
.toast{left:calc(50% + var(--side) / 2)}

/* 內容欄：一般的頁（讀書、解題、我、科目…）先放在最寬 --col 的欄裡置中，不拉到整個視窗寬；
   每一頁要多欄、要滿版（地圖、景點）就在自己的檔（read.css、solve.css …）改，這裡是還沒改到之前的底線。
   padding 的百分比是用視窗寬算的，所以要先扣掉導覽列。 */
:is(#s-read,#s-solve,#s-svbook,#s-svnote,#s-svq,#s-me,#s-mestats,#s-mebook,#s-meplus,#s-meset,#s-meaccount,#s-login,#s-meshare,#s-subj,#s-page,#s-focus,#s-fbook,#s-flog){padding-inline:max(0px,calc((100% - var(--side) - var(--col)) / 2))}

/* 面板：電腦上不從底下滑上來，是放在中間的視窗 */
#sheet .sh{inset:0;margin:auto;height:fit-content;width:min(560px,calc(100% - 64px));max-height:min(86%,820px);border-radius:30px;padding:28px 28px 28px}
#sheet .sh::before{display:none}

/* 平板窄導覽列：圖示在上、字在下，不放品牌名和下面的數字 */
@media (max-width:1199px){
  #side{padding:18px 8px}
  #side .side-brand{justify-content:center;margin:0 0 18px}
  #side .side-brand b,#side .side-foot{display:none}
  #side .side-tabs button{flex-direction:column;justify-content:center;gap:5px;height:68px;padding:0;font-size:13px}
  #side .side-tabs svg{width:28px;height:28px}
  #side .side-tabs .on::before{left:-8px;top:18px;bottom:18px}
  #side .side-tabs i{position:absolute;top:6px;left:calc(50% + 8px);margin:0;min-width:18px;height:18px;line-height:18px;font-size:11px;padding:0 5px;border-radius:9px}
}

/* 頭像 Studio（#s-avatar）自己有 ≥1000 的浮動視窗（scenes/avatar 的 .stage:has(#s-avatar.on)，demo html 用）；
   網頁版已經有電腦版框架，不要再縮成視窗：滿版、左邊是導覽列。景點樣式是進頁才載入，所以用 #stage（id）蓋過。 */
#stage:has(#s-avatar.on){width:100%;height:100vh;height:100dvh;border-radius:0}
