/* ============================================================
 * 左侧菜单能收窄、能拖（Mike 11-20 17:11；合并请求 #541，用例 7040–7041；行为在 public/js/side-resize.js）
 *   · 这份只管尺寸和显隐，不给侧栏上色：侧栏里的颜色只在外壳 core-v17-shell.css 里写（用例 6893 / 6894 的规矩），
 *     本件新加的拖动条、收起按钮的颜色也写在外壳里；这份排在「零件 → 外壳 → 换皮 → 手机」那一串前面（index.html）
 *   · 手机（<768 抽屉菜单）：logo、收起按钮、拖动条都不出；其余规则全在 min-width: 768px 里
 *   · 宽度走变量 --side-w（side-resize.js 写在 body 上），没拖过 = 220，和原来一样
 *   · body.side-narrow = 最窄态（64，只剩图标）；body.side-mid = 中间宽度（文字单行省略）；body.side-drag = 正在拖
 * ============================================================ */
body.app-shell .sidebar .sw-grip, body.app-shell .sidebar .sw-tog, body.app-shell .sidebar .sw-logo { display: none; }

@media (min-width: 768px) {
  body.app-shell .layout > .sidebar { width: var(--side-w, 220px); position: relative; transition: width .16s ease; }
  body.app-shell.side-drag .layout > .sidebar { transition: none; }
  body.app-shell.side-drag, body.app-shell.side-drag * { cursor: col-resize !important; user-select: none; }
  body.app-shell .sidebar .nav { overflow-x: hidden; }

  /* 拖动条：右边缘 6px 好抓；露出来的线只有 1px，悬停 / 键盘走到浅蓝、真在拖深蓝（颜色在外壳里） */
  body.app-shell .sidebar .sw-grip { display: block; position: absolute; top: 0; right: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 3; outline-style: none; }
  body.app-shell .sidebar .sw-grip::after { content: ''; position: absolute; top: 0; bottom: 0; right: 0; width: 1px; }   /* Mike 18:09：细一点、轻一点（颜色在外壳） */

  /* logo 那一行：收起 / 展开按钮在右边；logo 只在最窄态出 */
  body.app-shell .sidebar .brand { position: relative; }
  body.app-shell .sidebar .sw-logo { width: 32px; height: 32px; border-radius: var(--u-radius-md); }
  body.app-shell .sidebar .sw-tog { display: flex; position: absolute; top: 18px; right: 8px; width: 28px; height: 28px; padding: 0; align-items: center; justify-content: center;
    border-radius: var(--u-radius-md); cursor: pointer; }
  body.app-shell .sidebar .sw-tog svg { transition: transform .16s ease; }

  /* 中间宽度：两行字、分组小标题单行省略（菜单名本来就单行省略） */
  body.app-shell.side-mid .sidebar .brand { padding-right: 40px; }
  body.app-shell.side-mid .sidebar .brand .zh, body.app-shell.side-mid .sidebar .brand .en, body.app-shell.side-mid .sidebar .nav-sect { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* 最窄态：只剩图标 */
  body.app-shell.side-narrow .sidebar .brand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 0 6px; }
  body.app-shell.side-narrow .sidebar .brand .zh, body.app-shell.side-narrow .sidebar .brand .en { display: none; }
  body.app-shell.side-narrow .sidebar .sw-logo { display: block; }
  body.app-shell.side-narrow .sidebar .sw-tog { position: static; }
  body.app-shell.side-narrow .sidebar .sw-tog svg { transform: rotate(180deg); }
  body.app-shell.side-narrow .sidebar .nav { padding-left: 0; padding-right: 0; }
  body.app-shell.side-narrow .sidebar .nav-sect { height: 10px; padding: 0; font-size: 0; line-height: 0; overflow: hidden; }
  body.app-shell.side-narrow .sidebar .nav-item { position: relative; justify-content: center; margin: 0 8px 2px; padding: 8px 0; }
  body.app-shell.side-narrow .sidebar .nav-item .txt { display: none; }
  body.app-shell.side-narrow .sidebar .nav-item .ico { width: 20px; display: flex; justify-content: center; }
  body.app-shell.side-narrow .sidebar .nav-item .badge { position: absolute; top: 1px; right: 2px; min-width: 16px; height: 16px; margin: 0; padding: 0 4px; font-size: 10px; line-height: 16px; }
  body.app-shell.side-narrow .sidebar .nav-item .badge + .badge { top: auto; bottom: 1px; margin: 0; }
  body.app-shell.side-narrow .sidebar .user-box { flex-direction: column; gap: 6px; margin: 0 8px 12px; padding: 8px 0; }
  body.app-shell.side-narrow .sidebar .user-box .meta { display: none; }
  body.app-shell.side-narrow .sidebar .app-ver { display: none; }

  /* 最窄态悬停出菜单名（小框挂在 body 上，不在侧栏里） */
  body.app-shell .sw-tip { position: fixed; z-index: 1300; max-width: 260px; padding: 6px 10px; border-radius: var(--u-radius-md); background: var(--u-ink); color: var(--u-surface);
    font-size: 13px; line-height: 18px; white-space: nowrap; box-shadow: var(--u-shadow-pop); pointer-events: none; }
  body.app-shell .sw-tip[hidden] { display: none; }
}
