/* 公网页头模板（2026-10-12）：CesPage.header 配套——统一 [返回][标题][副题][功能][主页] 工具条。
   依赖页面 CSS 变量 --accent（可缺省）。map 页以 #topbar 规则覆盖 position 为 fixed。 */
header.ces-head { position: sticky; top: 0; z-index: 100; background: #24292f; color: #fff;
  padding: 10px 16px; display: flex; align-items: center; gap: 10px;
  padding-top: calc(10px + env(safe-area-inset-top)); }
header.ces-head h1 { font-size: 15px; font-weight: 600; margin: 0; flex: 1 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header.ces-head .ces-sub { color: #8b949e; font-size: 12px; white-space: nowrap; flex: 0 0 auto; }
header.ces-head .ces-back, header.ces-head .ces-home { color: #fff; background: #2f363d;
  border: 1px solid #444c56; border-radius: 6px; padding: 4px 10px; font-size: 12px;
  text-decoration: none; white-space: nowrap; flex: 0 0 auto; }
header.ces-head .ces-back:hover, header.ces-head .ces-home:hover { background: #3b444c; }
/* 页头工具链接（2026-10-15 relay 技能状态看板先用，2026-10-16 收编进共享层：admin 等页头链接同款） */
header.ces-head a.ces-status { color: #fff; background: #2f363d; border: 1px solid #444c56;
  border-radius: 6px; padding: 4px 10px; font-size: 12px; text-decoration: none;
  white-space: nowrap; flex: 0 0 auto; }
header.ces-head a.ces-status:hover { background: #3b444c; }
header.ces-head button { background: #2f363d; color: #fff; border: 1px solid #444c56;
  border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; flex: 0 0 auto; }
header.ces-head button:hover { background: #3b444c; }
header.ces-head button.on { background: var(--accent, #1890ff); border-color: var(--accent, #1890ff); }
header.ces-head label { color: #fff; font-size: 12px; cursor: pointer; user-select: none; flex: 0 0 auto; }
header.ces-head .actions { display: flex; gap: 10px; align-items: center; flex: 0 0 auto; }

/* 宽表手机横向滚动范式（2026-11-01 收编，admin/feedback 先例）：列多的表格包一层
   <div class="table-wrap"> + 表格按列数自设 min-width（约 560–900px），窄屏左右滑动看全列，
   桌面容器宽于 min-width 零变化。⚠️勿用 td position:sticky 钉整行详情——sticky 只能在
   同宽 tr 内移动，钉不住；详情内容用 max-width:calc(100vw - 48px) 限宽折行。 */
.table-wrap { overflow-x: auto; }

/* 通用 Tab 切换条（2026-11-06，CesTabs 配套，admin/skills/eparts 先例）：下划线式页签——
   <nav class="ces-tabs"><button class="ces-tab active" data-tab="名">…</button>…</nav>
   + 面板元素挂 data-panel="名" 互斥显隐（首 tab 在标记里预置 active，其余面板 hidden）。
   active/悬停吃页面 --accent/--text 变量（各页自定义）；tab 多时窄屏横向滚动不折行。 */
.ces-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line, #e3e6ea);
  margin-bottom: 16px; overflow-x: auto; }
.ces-tab { appearance: none; border: 0; background: none; font: inherit; font-size: 13.5px;
  color: #57606a; padding: 7px 13px 9px; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ces-tab:hover { color: var(--text, #24292f); }
.ces-tab.active { color: var(--accent, #1890ff); font-weight: 600;
  border-bottom-color: var(--accent, #1890ff); }
/* 导航型页签（2026-11-08）：<a class="ces-tab"> 点击跳页（CesTabs.init 不绑切换），去掉链接下划线 */
nav.ces-tabs a.ces-tab { text-decoration: none; }

/* 手机（2026-10-31 admin 手机端优化同批）：工具条允许换行——标题占首行、工具项流到次行，
   防窄屏下右侧「主页/退出」等被截出屏外（原 flex 不换行 + 各项 nowrap = 溢出硬裁）。
   仅 ≤640px 生效，桌面/平板布局零变化；map 页 #topbar 只覆盖 position，换行行为同此。 */
@media (max-width: 640px) {
  header.ces-head { flex-wrap: wrap; row-gap: 6px; }
  header.ces-head h1 { flex: 1 1 60%; }
}

/* ===== 左侧边导航（2026-11-23，public 全站）=====：CesSidebar.mount() 配套——
   桌面（>640px）常驻固定左栏（main 经 body.ces-has-sb 的 padding-left 让位，各页
   max-width 居中不受影响）；≤640px 收进抽屉（页头 ☰ 呼出 + 遮罩）。菜单项与首页模块卡
   同源（/api/home/modules 权限探测，fail-closed 同口径）。仅挂载页生效——CSS 全部挂在
   body.ces-has-sb / .ces-sb 前缀下，admin/login 等未挂载页零影响。顶距 = 页头实际高度
   （--ces-sb-top 由 JS 实测写入，页头换行加高后 resize 重算）；z-index 90：在页头(100)、
   各页弹窗(200~15000)之下，只做导航不抢层。 */
:root { --ces-sbw: 216px; --ces-sb-top: 42px; }
body.ces-has-sb { padding-left: var(--ces-sbw); }
.ces-sb { position: fixed; z-index: 90; left: 0; top: var(--ces-sb-top); bottom: 0;
  width: var(--ces-sbw); background: var(--card, #fff);
  border-right: 1px solid var(--line, #e3e6ea); overflow-y: auto;
  overscroll-behavior: contain; padding-bottom: 12px; }
.ces-sb .ces-sb-brand { display: block; padding: 13px 14px 9px; text-decoration: none;
  color: var(--text, #24292f); border-bottom: 1px solid var(--line, #e3e6ea); margin-bottom: 6px; }
.ces-sb .ces-sb-brand b { display: block; font-size: 14px; }
.ces-sb .ces-sb-brand span { display: block; font-size: 11px; color: var(--muted, #6a737d); margin-top: 1px; }
.ces-sb a.ces-sb-item { display: flex; align-items: center; gap: 9px; padding: 7px 12px 7px 11px;
  margin: 1px 6px 1px 3px; border-left: 3px solid transparent; border-radius: 0 6px 6px 0;
  color: var(--text, #24292f); text-decoration: none; font-size: 13.5px; white-space: nowrap; }
.ces-sb a.ces-sb-item .ico { font-size: 15px; flex: 0 0 auto; }
.ces-sb a.ces-sb-item:hover { background: rgba(24, 144, 255, .07); }
.ces-sb a.ces-sb-item.active { color: var(--accent, #1890ff); font-weight: 600;
  background: rgba(24, 144, 255, .10); border-left-color: var(--accent, #1890ff); }
.ces-sb a.ces-sb-item[hidden] { display: none; }
.ces-sb .ces-sb-note { padding: 8px 15px 0; font-size: 11px; color: var(--muted, #6a737d); }

/* 汉堡钮（≤640px 抽屉呼出；桌面侧栏常驻不显示）：外观沿用页头暗色按钮族（.ces-back 同款） */
.ces-burger { display: none; appearance: none; background: #2f363d; color: #fff;
  border: 1px solid #444c56; border-radius: 6px; padding: 4px 9px; font-size: 13px;
  cursor: pointer; flex: 0 0 auto; line-height: 1.3; }
.ces-sb-mask { position: fixed; inset: 0; z-index: 1400; background: rgba(0, 0, 0, .35); display: none; }

/* 折叠/呼回（2026-11-24）：桌面 >640px 侧栏可折叠——.ces-sb-fold 钉在侧栏右上角收起，
   body.ces-sb-off 隐藏侧栏并让出 padding-left，左上角浮动 .ces-sb-fab 呼回；状态
   localStorage('ces-sb-off') 由 JS 持久，跨页导航保持。≤640px 抽屉态两钮恒隐（基态 display:none）。
   fixed 定位不进侧栏滚动流（.ces-sb overflow-y:auto 会裁掉 absolute 钉顶），顶距随 --ces-sb-top 联动。 */
.ces-sb-fold, .ces-sb-fab { display: none; appearance: none; background: #2f363d; color: #fff;
  border: 1px solid #444c56; border-radius: 6px; width: 26px; height: 26px; padding: 0;
  font-size: 14px; line-height: 1; cursor: pointer; align-items: center; justify-content: center; }
.ces-sb-fold:hover, .ces-sb-fab:hover { background: #444c56; }
.ces-sb-fold { position: fixed; z-index: 91; left: calc(var(--ces-sbw) - 34px); top: calc(var(--ces-sb-top) + 9px); }
.ces-sb-fab { position: fixed; z-index: 91; left: 10px; top: calc(var(--ces-sb-top) + 9px); }
@media (min-width: 641px) {
  .ces-sb { transition: transform .18s ease; }
  .ces-sb-fold { display: flex; }
  body.ces-sb-off { padding-left: 0; }
  body.ces-sb-off .ces-sb { transform: translateX(-102%); }
  body.ces-sb-off .ces-sb-fold { display: none; }
  body.ces-sb-off .ces-sb-fab { display: flex; }
}

@media (max-width: 640px) {
  body.ces-has-sb { padding-left: 0; }
  .ces-burger { display: inline-block; }
  .ces-sb { z-index: 1401; top: 0; width: 232px; padding-top: calc(10px + env(safe-area-inset-top));
    transform: translateX(-105%); transition: transform .18s ease;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .25); }
  .ces-sb.open { transform: none; }
}

/* 全站页脚：备案号（2026-11-26，page.js 自动注入） */
.ces-footer { padding: 28px 16px 24px; text-align: center; font-size: 12px; }
.ces-footer a { color: var(--muted, #888); text-decoration: none; }
.ces-footer a:hover { text-decoration: underline; }
