body { background: var(--surface); font-family: var(--font); }
/* body 是 flex-col(root layout 的 tailwind class):flex 子項帶 auto 側邊距會關掉 stretch
   而縮成內容寬 → 置中容器一律補 width:100% 才不會塌 */
.lb-wrap { width: 100%; max-width: 1680px; margin: 0 auto; padding: 0 40px; }
.lb-nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.lb-nav-in { display: flex; align-items: center; gap: 14px; height: 64px; }
.lb-brand { display: flex; align-items: center; gap: 9px; } .lb-brand img { width: 32px; height: 32px; } .lb-wordmark { font-size: 1.26rem; color: var(--ink); }
.lb-nav .nlink { font-weight: 700; font-size: .92rem; color: var(--ink-2); padding: 8px 12px; border-radius: var(--r-sm); } .lb-nav .nlink:hover { background: var(--sunk); }
/* 登入後帳號區(NavAuth)*/
.nav-auth-skel { display: inline-block; width: 84px; height: 38px; border-radius: var(--r-pill); background: var(--sunk); }
.nav-acct { position: relative; }
.nav-acct-btn { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--surface); cursor: pointer; font-weight: 800; color: var(--ink); }
.nav-acct-btn:hover { background: var(--sunk); }
.nav-acct-av { width: 28px; height: 28px; border-radius: 50%; background: var(--teal-50); color: var(--teal); display: grid; place-items: center; flex-shrink: 0; }
.nav-acct-name { font-size: .9rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-acct-chev { color: var(--muted); flex-shrink: 0; }
.nav-acct-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; min-width: 172px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--sh-md); padding: 6px; display: flex; flex-direction: column; }
.nav-acct-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); font-weight: 700; font-size: .9rem; color: var(--ink-2); background: none; border: none; cursor: pointer; text-align: left; width: 100%; text-decoration: none; }
.nav-acct-item:hover { background: var(--sunk); }
.nav-acct-item svg { color: var(--muted); flex-shrink: 0; }
/* 全寬單欄頁(program / paper 模式,無側欄)*/
.lb-page { width: 100%; max-width: 1680px; margin: 0 auto; padding: 26px 40px 80px; }
/* 總覽/大類/搜尋:側欄 + 主欄 */
.lb-shell { display: flex; gap: 36px; align-items: flex-start; width: 100%; max-width: 1680px; margin: 0 auto; padding: 26px 40px 80px; }
.lb-side { width: 244px; flex-shrink: 0; position: sticky; top: 86px; }
.lb-side-h { display: flex; align-items: center; gap: 7px; font-size: .76rem; font-weight: 800; letter-spacing: .05em; color: var(--muted); padding: 0 10px 4px; }
.lb-side-h svg { color: var(--teal); }
.lb-side-sub { padding: 0 10px 12px; font-size: .82rem; font-weight: 700; color: var(--ink-2); line-height: 1.4; }
.lb-sidenav { display: flex; flex-direction: column; gap: 2px; }
.lb-sidelink { display: block; padding: 9px 11px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 700; font-size: .9rem; line-height: 1.35; }
.lb-sidelink:hover { background: var(--sunk); }
.lb-sidelink.on { background: var(--teal-50); color: var(--teal); }
.lb-main { flex: 1; min-width: 0; }
.lb-crumb { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; } .lb-crumb a { color: var(--muted); } .lb-crumb a:hover { color: var(--teal); } .lb-crumb .cur { color: var(--ink-2); }
.lb-head { margin-bottom: 22px; }
.lb-h1 { font-size: 1.9rem; font-weight: 900; letter-spacing: -0.01em; line-height: 1.3; }
.lb-sub { color: var(--muted); font-weight: 600; margin-top: 6px; font-size: .95rem; }
.lb-search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 7px 7px 7px 16px; margin-bottom: 24px; max-width: 580px; transition: border-color .14s, box-shadow .14s; }
.lb-search:focus-within { border-color: var(--teal-300); box-shadow: 0 0 0 3px var(--teal-50); }
.lb-search > svg { color: var(--muted); flex-shrink: 0; }
.lb-search input { flex: 1; min-width: 0; border: none; background: none; outline: none; font-size: .95rem; font-weight: 600; color: var(--ink); }
.lb-search input::placeholder { color: var(--muted); font-weight: 600; }
.lb-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.lb-search-btn { flex-shrink: 0; padding: 9px 20px; border: none; border-radius: var(--r-pill); background: var(--teal); color: #fff; font-weight: 800; font-size: .9rem; cursor: pointer; transition: filter .12s; }
.lb-search-btn:hover { filter: brightness(1.06); }
.lb-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.lb-catgroups { display: flex; flex-direction: column; gap: 30px; }
.lb-catsec-h { font-size: .82rem; font-weight: 800; letter-spacing: .05em; color: var(--muted); margin-bottom: 12px; }
.lb-sidegroup { margin-bottom: 14px; }
.lb-sidegroup-h { font-size: .7rem; font-weight: 800; letter-spacing: .06em; color: var(--muted); padding: 2px 11px 5px; }
.lb-cat { display: block; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh-xs); transition: transform .14s, box-shadow .14s, border-color .14s; }
.lb-cat:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--teal-100); }
.lb-cat .cn { font-size: 1.08rem; font-weight: 800; } .lb-cat .cm { font-size: .82rem; color: var(--muted); font-weight: 700; margin-top: 5px; }
.lb-cat .cgo { display: inline-flex; align-items: center; gap: 3px; margin-top: 12px; color: var(--teal); font-weight: 800; font-size: .85rem; }
.lb-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 13px; }
.lb-prow { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); }
.lb-prow:hover { border-color: var(--teal-300); background: var(--teal-50); } .lb-prow > svg { color: var(--muted); flex-shrink: 0; }
.lb-prow .pmeta { min-width: 0; } .lb-prow .pt { font-weight: 800; line-height: 1.4; } .lb-prow .pm { font-size: .8rem; color: var(--muted); font-weight: 700; margin-top: 2px; }
/* 篩選列 */
.lb-filter { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.lb-filter-l { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: .82rem; font-weight: 800; color: var(--muted); padding: 7px 0; } .lb-filter-l svg { color: var(--teal); }
.lb-chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.fchip { font-size: .85rem; font-weight: 700; color: var(--ink-2); background: var(--sunk); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; transition: all .12s; }
.fchip:hover { background: var(--teal-50); color: var(--teal); border-color: var(--teal-100); }
.fchip.on { background: var(--teal); color: #fff; border-color: var(--teal); }
/* 考卷列表 */
.lb-papers { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 13px; margin-top: 22px; }
.lb-paper { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); }
.lb-paper:hover { border-color: var(--teal-300); box-shadow: var(--sh-sm); }
.lb-paper > svg { color: var(--muted); flex-shrink: 0; margin-left: auto; }
.lb-paper .py { flex-shrink: 0; min-width: 52px; height: 52px; border-radius: 13px; background: var(--teal-50); color: var(--teal); font-weight: 900; font-size: 1.15rem; display: grid; place-items: center; }
.lb-paper .pmeta { min-width: 0; } .lb-paper .pt { font-weight: 800; line-height: 1.4; } .lb-paper .pm { font-size: .8rem; color: var(--muted); font-weight: 700; margin-top: 3px; }
/* 題目列表(卷內)*/
.lb-qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 13px; }
.lb-q { display: flex; align-items: flex-start; gap: 12px; padding: 15px 16px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-md); }
.lb-q:hover { border-color: var(--teal-300); box-shadow: var(--sh-sm); }
.lb-q .qn { flex-shrink: 0; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 9px; background: var(--teal-50); color: var(--teal); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.lb-q .qmeta { min-width: 0; } .lb-q .qt { font-weight: 700; line-height: 1.55; font-size: .93rem; }
.lb-empty { padding: 50px; text-align: center; color: var(--muted); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
@media (max-width: 900px) {
  .lb-shell, .lb-page { padding: 18px 20px 60px; }
  .lb-shell { flex-direction: column; gap: 16px; }
  .lb-wrap { padding: 0 20px; }
  .lb-side { width: 100%; max-width: 100%; min-width: 0; position: static; }
  .lb-main { width: 100%; }
  .lb-sidenav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .lb-sidelink { flex-shrink: 0; border: 1px solid var(--line-2); white-space: nowrap; }
  .lb-sidegroup { display: contents; } .lb-sidegroup-h { display: none; }
  .lb-filter { flex-direction: column; gap: 8px; }
  .lb-search { max-width: none; }
}
@media (max-width: 600px) {
  .lb-wrap { padding: 0 12px; }
  .lb-nav-in { gap: 8px; }
  .lb-brand { flex-shrink: 0; gap: 6px; }
  .lb-brand img { width: 28px; height: 28px; }
  .lb-wordmark { font-size: 1.1rem; }
  .lb-nav .btn { white-space: nowrap; padding: 9px 12px !important; font-size: 13px; }
  .lb-qgrid, .lb-pgrid, .lb-papers, .lb-cats { grid-template-columns: minmax(0, 1fr); }
  .lb-main { overflow-wrap: anywhere; }
  .lb-nav .nav-acct-name, .lb-nav .nav-acct-chev { display: none; }
  .lb-nav .nav-acct-btn { justify-content: center; width: 40px; height: 40px; padding: 0; gap: 0; border-radius: 50%; }
  .lb-nav .nav-acct-av { background: transparent; }
}
