/* ============================================================================
   慵懒半径 v2 · responsive.css（响应式自适应）
   ----------------------------------------------------------------------------
   决策依据：计划书第 13 节决策表 #16（4 档断点 375/768/1024/1440）
                              #20（可折叠侧栏 240↔64 + 面包屑）
   ----------------------------------------------------------------------------
   4 档断点：
     - 手机  （<768px）  ：底部 tabbar 导航 + 单栏内容
     - 平板  （768-1024） ：可折叠侧栏 + 主区
     - 桌面  （1024-1440） ：固定侧栏 + 主区 + 面包屑
     - 大屏  （≥1440）    ：限宽内容区居中
   ----------------------------------------------------------------------------
   结构（由 core.js router 渲染到 #app）：
     <aside class="app-sidebar">       桌面侧栏（≥768 显示）
       <div class="sidebar-brand">    品牌 + 折叠按钮
       <nav class="sidebar-nav">      导航项
     <main class="app-main">           主区
       <header class="app-topbar">     顶栏（面包屑 + 用户）
       <div class="app-content">       内容滚动区
     <nav class="app-tabbar">          移动底部 tabbar（<768 显示）
   ============================================================================ */

/* ========== 1. 桌面端侧栏（≥768px） ========== */
.app-sidebar {
  display: none;                       /* 移动端隐藏，媒体查询内显示 */
  position: relative;
  grid-column: 1;
  grid-row: 1;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-deep);
  border-right: 1px solid var(--border);
  flex-direction: column;
  overflow: hidden;
  transition: width var(--dur-3) var(--ease-out);
  z-index: 10;
}

/* 侧栏品牌区 */
.sidebar-brand {
  flex: 0 0 auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.sidebar-brand .brand-badge {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--elev-brand);
}
.sidebar-brand .brand-badge svg { width: 18px; height: 18px; }
.sidebar-brand .brand-badge .iconfont { font-size: 18px; line-height: 1; color: #fff; }
.sidebar-brand .brand-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
  white-space: nowrap;
  transition: opacity var(--dur-2);
}
.sidebar-brand .sidebar-toggle {
  margin-left: auto;
  width: 32px; height: 32px;
  border-radius: var(--r-xs);
  border: none;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--dur-2);
}
.sidebar-brand .sidebar-toggle:hover {
  background: var(--slate-100);
  color: var(--brand);
}
.sidebar-brand .sidebar-toggle svg { width: 18px; height: 18px; transition: transform var(--dur-2) var(--ease-out); }
/* 折叠态：箭头旋转 180° 指向右侧，提示点击可展开 */
.app-sidebar.collapsed .sidebar-brand .sidebar-toggle svg { transform: rotate(180deg); }

/* 侧栏导航 */
.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-nav::-webkit-scrollbar { width: 0; }

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--text-light);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: var(--dur-2);
  white-space: nowrap;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.sidebar-nav-item:hover {
  background: var(--slate-100);
  color: var(--text);
}
.sidebar-nav-item.active {
  background: var(--brand-100);
  color: var(--brand);
  font-weight: 600;
}
.sidebar-nav-item .nav-icon {
  width: 22px; height: 22px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  line-height: 1;
}
.sidebar-nav-item .nav-icon svg { width: 20px; height: 20px; }
.sidebar-nav-item .nav-icon .iconfont { font-size: 20px; line-height: 1; }
.sidebar-nav-item .nav-label {
  transition: opacity var(--dur-2);
}

/* 侧栏底部用户区 */
.sidebar-user {
  flex: 0 0 auto;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user .user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-sm); font-weight: 700;
  flex-shrink: 0;
}
.sidebar-user .user-meta {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.sidebar-user .user-erp {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.sidebar-user .user-role {
  font-size: var(--fs-xs);
  color: var(--text-lighter);
}
.sidebar-user .logout-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-xs);
  border: none;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: var(--dur-2);
}
.sidebar-user .logout-btn:hover {
  background: var(--brand-100);
  color: var(--danger);
}
.sidebar-user .logout-btn svg { width: 18px; height: 18px; }

/* ---------- 侧栏折叠态（240 → 64） ---------- */
.app-sidebar.collapsed { width: var(--sidebar-collapsed); }
.app-sidebar.collapsed .sidebar-brand { padding: 0; justify-content: center; gap: 0; }
.app-sidebar.collapsed .sidebar-brand .brand-title,
.app-sidebar.collapsed .sidebar-nav-item .nav-label,
.app-sidebar.collapsed .sidebar-user .user-meta,
.app-sidebar.collapsed .sidebar-user .logout-btn { display: none; }
.app-sidebar.collapsed .sidebar-nav-item {
  justify-content: center;
  padding: 10px;
}
.app-sidebar.collapsed .sidebar-user {
  flex-direction: column;
  gap: 6px;
  padding: 10px 6px;
}
.app-sidebar.collapsed .sidebar-brand .sidebar-toggle {
  position: fixed;
  top: calc((var(--header-h) - 32px) / 2);
  left: calc(var(--sidebar-collapsed) - 12px);
  margin: 0;
  z-index: 100;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
/* 折叠态 hover 气泡提示 */
.app-sidebar.collapsed .sidebar-nav-item:hover::after {
  content: attr(data-label);
  position: absolute;
  left: calc(var(--sidebar-collapsed) + 6px);
  background: var(--slate-900);
  color: #fff;
  padding: 6px 10px;
  border-radius: var(--r-xs);
  font-size: var(--fs-xs);
  white-space: nowrap;
  z-index: 1000;
  box-shadow: var(--elev-3);
  pointer-events: none;
}
.app-sidebar.collapsed .sidebar-nav-item { position: relative; }

/* ========== 2. 主区 + 顶栏 + 面包屑 ========== */
.app-main {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;                        /* 防 grid 溢出 */
  overflow: hidden;
}

/* 顶栏（桌面端白底，含面包屑 + 用户） */
.app-topbar {
  flex: 0 0 auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--elev-1);
  z-index: 5;
}
/* 品牌徽章：桌面端默认隐藏（桌面用侧栏品牌区） */
.topbar-brand {
  display: none;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.topbar-brand .brand-badge {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.22);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.topbar-brand .brand-badge svg { width: 20px; height: 20px; }
.topbar-brand .brand-badge .iconfont { font-size: 20px; line-height: 1; color: #fff; }
.topbar-brand .brand-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  font-size: var(--fs-sm);
}
.breadcrumb-item {
  color: var(--text-lighter);
  white-space: nowrap;
}
.breadcrumb-item.current {
  color: var(--text);
  font-weight: 600;
}
.breadcrumb-sep {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}
.breadcrumb-home {
  display: flex;
  align-items: center;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--dur-2);
}
.breadcrumb-home:hover { color: var(--brand); }
.breadcrumb-home svg { width: 16px; height: 16px; }

/* 顶栏右侧操作区 */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--slate-100);
  color: inherit;
  cursor: pointer;
  transition: var(--dur-2);
}
.topbar-user:hover { background: var(--slate-200); }
.topbar-user .user-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: 700;
}
.topbar-user .user-erp {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

/* 内容滚动区 */
.app-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
}
.app-content::-webkit-scrollbar { width: 6px; }
.app-content::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 3px;
}
.app-content::-webkit-scrollbar-track { background: transparent; }

/* ========== 3. 移动端底部 tabbar — 浮动胶囊毛玻璃（<768px） ========== */
.app-tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  transform: translateX(-50%);
  height: 58px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(15,23,42,0.16), 0 2px 8px rgba(15,23,42,0.08), inset 0 1px 0 rgba(255,255,255,0.5);
  display: flex;
  padding: 6px;
  gap: 4px;
  z-index: 100;
  width: min(94%, 360px);
  transition: transform 0.32s var(--ease-out, cubic-bezier(0.22,1,0.36,1)),
              opacity 0.24s var(--ease-out, cubic-bezier(0.22,1,0.36,1));
}
/* 任务执行弹层打开时隐藏底部 tabbar，避免遮挡内容 */
body.sheet-open .app-tabbar {
  transform: translateX(-50%) translateY(160%);
  opacity: 0;
  pointer-events: none;
}
/* 弹层打开时隐藏顶部栏，给弹层腾出完整垂直空间，避免弹层顶部被顶栏遮挡 */
body.sheet-open .app-topbar {
  display: none;
}
/* 任务执行弹层打开时同步隐藏 FAB 收缩菜单按钮（含管理员居中嵌入态），避免遮挡内容 */
body.sheet-open .fab-wrap {
  transform: translateY(160%);
  opacity: 0;
  pointer-events: none;
}
body.sheet-open .fab-wrap.is-center {
  /* 居中态需保留 translateX(-50%) 以避免回弹错位 */
  transform: translateX(-50%) translateY(160%);
}
/* 弹层打开时若 FAB 扇形菜单曾展开，同步隐藏其遮罩，避免残留 */
body.sheet-open .fab-mask {
  opacity: 0 !important;
  pointer-events: none !important;
}
.tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--text-light);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 10px;
  min-width: 0;
  overflow: hidden;
  transition: color 0.25s, background 0.3s, box-shadow 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.tabbar-item .tab-icon {
  width: 21px; height: 21px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 20px;
  line-height: 1;
}
.tabbar-item .tab-icon svg { width: 21px; height: 21px; }
.tabbar-item .tab-icon .iconfont { font-size: 20px; line-height: 1; }
.tabbar-item .tab-label {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.tabbar-item.active {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 5px 16px rgba(249,115,22,0.42);
}
.tabbar-item.active .tab-icon { transform: scale(1.1); }
.tabbar-item.active .tab-label { font-weight: 700; }

/* 窄屏压缩 */
@media (max-width: 380px) {
  .app-tabbar { width: min(96%, 360px); gap: 3px; padding: 5px; }
  .tabbar-item { padding: 9px 6px; gap: 4px; }
  .tabbar-item .tab-label { font-size: 11px; }
  .tabbar-item .tab-icon, .tabbar-item .tab-icon svg { width: 19px; height: 19px; }
}

/* ========== 3b. FAB 浮动菜单 — 垂直散开式（管理员移动端） ========== */
.fab-wrap {
  position: fixed;
  right: 20px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
  z-index: 200;
  transition: transform 0.32s var(--ease-out, cubic-bezier(0.22,1,0.36,1)),
              opacity 0.24s var(--ease-out, cubic-bezier(0.22,1,0.36,1));
}
.fab-btn {
  width: 54px; height: 54px;
  border-radius: 50%;
  /* 扁平设计：纯色品牌橙，无渐变 */
  background: var(--brand);
  border: none;
  /* 扁平阴影：单层柔和投影 */
  box-shadow: 0 4px 12px rgba(249,115,22,0.35), 0 1px 3px rgba(15,23,42,0.08);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  z-index: 2;
  color: #fff;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s, background 0.25s;
  -webkit-tap-highlight-color: transparent;
}
.fab-btn:hover { transform: scale(1.05); box-shadow: 0 6px 16px rgba(249,115,22,0.42); }
.fab-btn:active { transform: scale(0.94); }
.fab-btn svg, .fab-btn i { position: absolute; transition: transform 0.35s, opacity 0.25s; }
.fab-btn svg { width: 24px; height: 24px; }
.fab-btn i { font-size: 24px; line-height: 1; }
.fab-ico-close { opacity: 0; transform: rotate(-90deg); }
.fab-wrap.open .fab-btn {
  /* 打开态：深一档橙色，仍扁平 */
  background: var(--brand-400);
  box-shadow: 0 4px 12px rgba(234,88,12,0.4);
  transform: rotate(135deg);
}
.fab-wrap.open .fab-ico-plus { opacity: 0; transform: rotate(90deg); }
.fab-wrap.open .fab-ico-close { opacity: 1; transform: rotate(0deg); }

/* 遮罩 */
.fab-mask {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.35);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1;
}
.fab-wrap.open .fab-mask { opacity: 1; pointer-events: auto; }

/* 散开菜单 — 绝对定位垂直散开 */
.fab-menu {
  position: absolute;
  right: 7px;
  bottom: 62px;
  z-index: 1;
}
.fab-menu-item {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate(0, 0) scale(0.5);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
}
.fab-wrap.open .fab-menu-item {
  opacity: 1;
  pointer-events: auto;
  transform: translate(calc(var(--i) * -2px), calc(var(--i) * -68px)) scale(1);
  transition-delay: calc(var(--i) * 0.05s);
}
.fab-mi-icon {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  /* 扁平阴影：柔和单层 */
  box-shadow: 0 3px 10px rgba(15,23,42,0.18), 0 1px 2px rgba(15,23,42,0.06);
  border: none;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.fab-mi-icon svg { width: 22px; height: 22px; }
.fab-mi-icon .iconfont { font-size: 22px; line-height: 1; color: #fff; }
/* 扁平化：图标用纯白色描边，不再覆盖 stroke */
.fab-mi-icon svg use { color: #fff; }
.fab-menu-item:active .fab-mi-icon { transform: scale(0.88); }
.fab-mi-label {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(15,23,42,0.88);
  padding: 5px 12px;
  border-radius: 10px;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(15,23,42,0.2);
  order: -1;
}

/* 移动端内容区底部留白 */
.app-content {
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

/* ========== 4. 移动端顶栏（<768px）—— 旧版 glass.css 风格：白底毛玻璃 ========== */
@media (max-width: 767px) {
  .app-topbar {
    /* 旧版 glass.css：白底毛玻璃，无顶部/左右留白 */
    padding: 12px 14px 8px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 8px rgba(15, 23, 42, 0.04);
    color: var(--text);
    height: auto;
    gap: 10px;
  }
  /* 移动端显示品牌徽章 */
  .topbar-brand {
    display: flex;
    flex: 1;
    min-width: 0;
  }
  /* 旧版：徽章橙色渐变方块 + 橙色辉光 */
  .topbar-brand .brand-badge {
    background: var(--brand);
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.30);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .topbar-brand .brand-badge svg path,
  .topbar-brand .brand-badge svg { color: #fff; }
  /* 旧版：标题深色文字 */
  .topbar-brand .brand-title { color: var(--text); }
  /* 隐藏面包屑（移动端只显示品牌 + 用户） */
  .breadcrumb { display: none; }
  /* 旧版用户胶囊：浅灰白底 + 1px 边框 */
  .app-topbar .topbar-user {
    background: var(--slate-100);
    border: 1px solid var(--border);
    padding: 4px 10px 4px 4px;
    flex-shrink: 0;
  }
  .app-topbar .topbar-user:hover { background: var(--slate-200); }
  .app-topbar .topbar-user:active { transform: scale(0.95); }
  .app-topbar .topbar-user .user-erp { color: var(--text); }
  /* 旧版：头像橙色渐变 + 橙色辉光 */
  .app-topbar .topbar-user .user-avatar {
    width: 28px; height: 28px;
    background: var(--brand);
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.30);
  }
  /* 移动端顶栏内嵌 Toast：与 .topbar-user 视觉一致（灰白底 + 1px 边框，头像 28x28，左 4px 对齐） */
  .app-topbar .topbar-toast {
    height: 38px;
    padding: 0 10px 0 4px;
  }
  .app-topbar .topbar-toast .toast-icon {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
  }
}

/* ========== 5. 响应式断点 ========== */

/* 5.1 手机端默认（<768px）：单栏 + tabbar，隐藏侧栏 */
@media (max-width: 767px) {
  #app {
    display: block;
    height: 100vh;
    height: 100dvh;                    /* 动态视口高度，避免 iOS 工具栏跳动 */
  }
  .app-sidebar { display: none; }
  .app-main {
    grid-column: 1;
    height: 100vh;
    height: 100dvh;
  }
  /* 移动端：左右贴边，但顶部留 8px、底部必须留白避开浮动 tabbar */
  .app-content {
    padding: 8px 0 0 0;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

/* 5.2 平板起（≥768px）：显示侧栏，隐藏 tabbar */
@media (min-width: 768px) {
  .app-sidebar { display: flex; }
  .app-tabbar { display: none; }
  .fab-wrap { display: none; }
  body.admin-mobile-nav .fab-wrap.is-center { display: none; }   /* 桌面端无论如何都隐藏 */
  .app-content { padding-bottom: 20px; }
  /* 折叠态：grid 第一列跟随收缩到 64px，避免侧栏错位与右侧内容区留白 */
  #app:has(.app-sidebar.collapsed) {
    grid-template-columns: var(--sidebar-collapsed) 1fr;
  }
}

/* ============================================================================
   6. 管理员移动端专属布局（<768px 且 body.admin-mobile-nav）
      tabbar 仅两项（待执行/轮休日历），中间嵌一个圆形槽位供 FAB 半入半出；
      FAB 点击后菜单项 180° 上半圆扇形散开（扇子效果）
   ============================================================================ */
@media (max-width: 767px) {
  body.admin-mobile-nav .app-tabbar.admin-layout {
    /* 对齐 zhuweijian.10 普通用户 tabbar 的视觉比例：高度 72px / 每格 117×58 / 图标 22-24 / 标签 13-14
       之前 58+6=64px 偏扁（用户反馈"有点扁的感觉视觉上就不好"），
       所以改成 height: 72px + padding: 8px + 网格三列（中间 72 留槽位），
       让管理员胶囊看起来和普通角色一样饱满协调 */
    display: grid;
    grid-template-columns: 1fr 72px 1fr;
    align-items: center;
    justify-items: stretch;
    width: min(96%, 420px);
    height: 72px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    padding: 8px;
    gap: 2px;
  }
  body.admin-mobile-nav .app-tabbar.admin-layout .tabbar-item {
    /* 两格：待执行 / 轮休日历，高度对齐普通角色的 58，宽度占满列
       图标 24 / 标签 13，间距足够不拥挤；选中橙底高亮更协调 */
    justify-self: stretch;
    align-self: center;
    height: 58px;
    padding: 8px 6px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  body.admin-mobile-nav .app-tabbar.admin-layout .tabbar-item .tab-icon {
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
  }
  body.admin-mobile-nav .app-tabbar.admin-layout .tabbar-item .tab-icon svg,
  body.admin-mobile-nav .app-tabbar.admin-layout .tabbar-item .tab-icon svg { width: 24px; height: 24px; }
  body.admin-mobile-nav .app-tabbar.admin-layout .tabbar-item .tab-icon .iconfont { font-size: 22px; line-height: 1; }
  body.admin-mobile-nav .app-tabbar.admin-layout .tabbar-item .tab-label {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
  }
  body.admin-mobile-nav .app-tabbar.admin-layout .tabbar-item.active .tab-icon { transform: scale(1.08); }
  body.admin-mobile-nav .app-tabbar.admin-layout .tabbar-item.active .tab-label { font-weight: 700; }
  body.admin-mobile-nav .app-tabbar.admin-layout .tabbar-item:nth-child(1) { grid-column: 1; }
  body.admin-mobile-nav .app-tabbar.admin-layout .tabbar-item:nth-child(2) { grid-column: 3; }

  /* —— FAB 半内半外：圆心对齐 tabbar 上边缘 —— */
  body.admin-mobile-nav .fab-wrap.is-center {
    /* 关键：清掉旧 .fab-wrap 的 right/bottom，否则 left:50% + right:24px 会把盒子拉伸，
       translateX(-50%) 基于错误盒宽计算，FAB 会错位到左侧 */
    position: fixed;
    top: auto;
    right: auto;
    left: 50%;
    /* 半嵌入公式：
       FAB 圆心 y = tabbar 上沿线 = tabbar y
       FAB 顶部 y = tabbar y - 30  →  bottom = viewport_h - (tabbar_y - 30 + 60)
                                             = viewport_h - tabbar_y - 30
       tabbar_y = viewport_h - tabbar_bottom_margin(14) - tabbar_height(72)
       所以 FAB bottom = viewport_h - (viewport_h - 14 - 72) - 30 = 14 + 72 - 30 = 56 ✓
       但浏览器实测 cyVsTabbarTop = +14（圆心跑到 tabbar 里 14px 才到上沿）
       → 说明 bottom 值太小（FAB 整体太靠下）→ 将 bottom 再减小 14 → = safe+42 */
    bottom: calc(env(safe-area-inset-bottom, 0px) + 42px);
    transform: translateX(-50%);
    z-index: 201;
    overflow: visible;
  }
  body.admin-mobile-nav .fab-wrap.is-center .fab-btn {
    width: 60px;
    height: 60px;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.9), 0 4px 18px rgba(249,115,22,0.4), 0 1px 3px rgba(15,23,42,0.06);
    background: var(--brand);
  }
  body.admin-mobile-nav .fab-wrap.is-center .fab-btn:active { transform: scale(0.93); }
  body.admin-mobile-nav .fab-wrap.is-center.open .fab-btn {
    /* 注意：fab-wrap 本身有 transform:translateX(-50%)，
       子元素的 transform 会跟父级叠加，不是覆盖，因此旋转 135° 正常生效 */
    transform: rotate(135deg);
    background: var(--brand-400);
  }
  body.admin-mobile-nav .fab-wrap.is-center.open .fab-btn:active {
    transform: rotate(135deg) scale(0.93);
  }

  /* —— 扇子（180° 上半圆）散开动画 —— */
  body.admin-mobile-nav .fab-wrap.is-center .fab-menu {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    z-index: 1;
    pointer-events: none;
  }
  body.admin-mobile-nav .fab-wrap.is-center .fab-menu-item {
    position: absolute;
    /* 图标 52x52，半宽 26；left/top = -26 → 图标中心正好落在 fab-menu 原点 = FAB 圆心 */
    left: -26px;
    top:  -26px;
    width: 52px;
    height: 52px;
    display: block;
    transform-origin: 26px 26px;
    opacity: 0;
    pointer-events: none;
    /* 用户反馈扇形菜单遮挡底部菜单栏，再上移 10px 保持间距：
       闭合态/展开态同时整体上抬 30px，保证扇叶底部与 FAB 顶部、
       底部菜单栏之间保持合理留白 */
    transform: translate(0px, -30px) rotate(var(--angle, 0deg)) translate(0px, 0px) rotate(calc(-1 * var(--angle, 0deg))) scale(0.45);
    transition: transform 0.56s cubic-bezier(0.22, 1.3, 0.36, 1), opacity 0.32s ease;
  }
  body.admin-mobile-nav .fab-wrap.is-center.open .fab-menu-item {
    opacity: 1;
    pointer-events: auto;
    transform: translate(0px, -30px) rotate(var(--angle, 0deg)) translate(0px, -160px) rotate(calc(-1 * var(--angle, 0deg))) scale(1);
    transition-delay: calc(var(--i, 0) * 0.03s);
  }
  /* 管理员扇子：只展示图标，隐藏文字标签（移动端位置不够，避免文字被挤出屏幕或重叠） */
  body.admin-mobile-nav .fab-wrap.is-center .fab-mi-label {
    display: none !important;
  }
  /* 扇叶图标：尺寸 52px，比之前 46px 略大，与大半径扇子更协调 */
  body.admin-mobile-nav .fab-wrap.is-center .fab-mi-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
  }

  /* 管理员移动端：内容底部留足安全高度（tabbar + FAB 一半突出） */
  body.admin-mobile-nav .app-content {
    padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  }
}

/* 5.3 桌面（≥1024px）：侧栏更宽松 */
@media (min-width: 1024px) {
  .app-content { padding: 24px 28px; }
  .app-topbar { padding: 0 28px; }
}

/* 5.4 大屏（≥1440px）：内容区限宽居中 */
@media (min-width: 1440px) {
  #app {
    max-width: var(--content-max);
    margin: 0 auto;
  }
  .app-content {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
  }
}

/* 5.5 超小手机（<375px）：缩小顶栏间距 */
@media (max-width: 374px) {
  .app-topbar { padding: 10px 10px 6px; gap: 8px; }
  .app-content {
    padding: 6px 0 0 0;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
  .tabbar-item .tab-label { font-size: 9px; }
  .topbar-user .user-erp { display: none; }
  .topbar-user { padding: 5px; }
  /* 超小屏：顶栏 Toast 隐藏文字、纯图标胶囊居中，避免溢出 */
  .topbar-toast { padding: 0; width: 38px; height: 38px; justify-content: center; }
  .topbar-toast .toast-message { display: none; }
}

/* ========== 6. 折叠态过渡：标签淡入淡出 ========== */
.sidebar-nav-item .nav-label,
.sidebar-brand .brand-title,
.sidebar-user .user-meta {
  transition: opacity var(--dur-2);
}
.app-sidebar.collapsed .sidebar-nav-item .nav-label,
.app-sidebar.collapsed .sidebar-brand .brand-title,
.app-sidebar.collapsed .sidebar-user .user-meta {
  opacity: 0;
  pointer-events: none;
}

/* ========== 7. 无障碍：尊重 prefers-reduced-motion ========== */
@media (prefers-reduced-motion: reduce) {
  .app-sidebar,
  .sidebar-nav-item,
  .tabbar-item .tab-icon,
  .topbar-user {
    transition: none;
  }
  .tabbar-item.active .tab-icon { transform: none; }
}
