/*
 * design/themes/apple-shell.css —— Apple 风格外壳范式
 * inspired by Apple macOS 系统设置 / iOS，非官方实现。
 * 范式：macOS 设置式分组侧栏（搜索 + 彩色图标方块 + 整行选中）+ ≤1023 iOS Tab Bar；
 * 「更多」弹分组列表面板（bottom sheet）。
 * 本文件可脱离表单层单独使用：accent / focus 令牌随 body[data-shell] 提供。
 */
body[data-shell="apple"] {
  --accent: #0071e3;
  --accent-ink: #ffffff;
  --focus-ring: rgba(0, 113, 227, .22);
  --sh-top-bg: rgba(255, 255, 255, .92);
  --sh-top-line: #e5e5ea;
  --sh-line: #d2d2d7;
  --sh-ink: #1d1d1f; --sh-ink-2: #515154; --sh-muted: #86868b; --sh-weak: #d2d2d7;
  --sh-side-bg: #f5f5f7;
  --sh-side-text: #1d1d1f;
  --sh-side-hover: rgba(0, 0, 0, .045);
  --sh-side-active-bg: #0071e3;
  --sh-side-active-text: #ffffff;
  --sh-side-muted: #86868b;
  --sh-side-icon: #ffffff;
  --sh-sheet-bg: #ffffff;
  --sh-tabbar-bg: rgba(249, 249, 251, .94);
  --sh-tab-active: #0071e3;
}

/* ---------- 桌面：设置分组侧栏 ---------- */
body[data-shell="apple"] .sh-side { background: var(--sh-side-bg); border-right: 1px solid #e5e5ea; }
body[data-shell="apple"] .sh-brand { padding: 0 8px 12px; margin-bottom: 8px; }
body[data-shell="apple"] .sh-main { margin-left: 256px; }
body[data-shell="apple"] .sh-item { padding: 7px 10px; }
body[data-shell="apple"] .sh-item.is-active::before { display: none; }
body[data-shell="apple"] .sh-item.is-active .sh-ico { color: #fff; }

/* 侧栏搜索框（分组列表顶部的惯例件） */
.sh-search {
  display: flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 10px; margin: 0 4px 12px;
  border: none; border-radius: 8px;
  background: rgba(0, 0, 0, .06); color: #86868b;
}
.sh-search input { flex: 1; min-width: 0; border: none; background: transparent; font: inherit; font-size: 13px; color: #1d1d1f; }
.sh-search input:focus { outline: none; }
.sh-search .sh-ico { color: inherit; } /* 搜索框在侧栏内，但不吃侧栏图标色 */

/* 彩色图标方块（设置分组列表语系）：.sh-ico 按 data-ico 上色，--sq 为方块底色 */
body[data-shell="apple"] .sh-item .sh-ico {
  width: 24px; height: 24px; border-radius: 6px; padding: 0;
  align-items: center; justify-content: center;
  background: var(--sq, #8e8e93);
  color: #fff !important;
}
body[data-shell="apple"] .sh-item .sh-ico svg { width: 13px; height: 13px; }
body[data-shell="apple"] .sh-ico[data-ico="doc"], body[data-shell="apple"] .sh-ico[data-ico="report"] { --sq: #0071e3; }
body[data-shell="apple"] .sh-ico[data-ico="clip"], body[data-shell="apple"] .sh-ico[data-ico="pen"] { --sq: #34c759; }
body[data-shell="apple"] .sh-ico[data-ico="chart"] { --sq: #5856d6; }
body[data-shell="apple"] .sh-ico[data-ico="sync"] { --sq: #ff9500; }
body[data-shell="apple"] .sh-ico[data-ico="chat"] { --sq: #ff2d55; }
body[data-shell="apple"] .sh-ico[data-ico="users"], body[data-shell="apple"] .sh-ico[data-ico="user"] { --sq: #5ac8fa; }
body[data-shell="apple"] .sh-ico[data-ico="gear"] { --sq: #8e8e93; }
body[data-shell="apple"] .sh-ico[data-ico="box"], body[data-shell="apple"] .sh-ico[data-ico="out"],
body[data-shell="apple"] .sh-ico[data-ico="in"], body[data-shell="apple"] .sh-ico[data-ico="trash"],
body[data-shell="apple"] .sh-ico[data-ico="book"] { --sq: #00c7be; }
body[data-shell="apple"] .sh-ico[data-ico="flask"], body[data-shell="apple"] .sh-ico[data-ico="board"],
body[data-shell="apple"] .sh-ico[data-ico="list"], body[data-shell="apple"] .sh-ico[data-ico="plus"],
body[data-shell="apple"] .sh-ico[data-ico="cap"] { --sq: #af52de; }
body[data-shell="apple"] .sh-ico[data-ico="check"] { --sq: #ff9500; }
body[data-shell="apple"] .sh-ico[data-ico="wrench"], body[data-shell="apple"] .sh-ico[data-ico="search"],
body[data-shell="apple"] .sh-ico[data-ico="grid"] { --sq: #636366; }

/* ---------- ≤1023：侧栏 → iOS Tab Bar ---------- */
@media (max-width: 1023px) {
  body[data-shell="apple"] .sh-side { display: none; }
  body[data-shell="apple"] .sh-main { margin-left: 0; }
  body[data-shell="apple"] .sh-top { padding: 0 12px; }
  body[data-shell="apple"] .sh-body { padding-bottom: 70px; }
}
