/* The search box and the bar of the pages opened from the console (shell.js, shellbar.js) - 功能整合, 2026-10-28.
 * Colours come from the page that shows them where it has them, else from its light / dark scheme. */
.sh-search, .shellbar, .sb-rail { --sh-bg: #ffffff; --sh-fg: #1d1d1f; --sh-muted: #5b6068; --sh-line: #dfe2e7; --sh-field: #f1f2f5; --sh-blue: #2f4bd0;
  --sh-today: #1d1d1f; --sh-today-soft: #ececf0; --sh-wh: #2f4bd0; --sh-wh-soft: #e9edfc; --sh-shop: #b03a20; --sh-shop-soft: #fbe9e4;
  --sh-adm: #3d434b; --sh-adm-soft: #e8eaee; --sh-studio: #8a3ab9; --sh-studio-soft: #f3e8fb; --sh-ok: #1b6e3e; --sh-warn: #8a4b00; --sh-bad: #b3261e;
  --sh-office: #0f766e; --sh-office-soft: #e2f3f1; }
@media (prefers-color-scheme: dark) {
  .sh-search, .shellbar, .sb-rail { --sh-bg: #1c1d21; --sh-fg: #ececf0; --sh-muted: #a3a8b0; --sh-line: #34363c; --sh-field: #2a2c32; --sh-blue: #8fa3ff;
    --sh-today: #ececf0; --sh-today-soft: #2f3138; --sh-wh: #8fa3ff; --sh-wh-soft: #1e2646; --sh-shop: #f07a5f; --sh-shop-soft: #3a231d;
    --sh-adm: #c5cad1; --sh-adm-soft: #2a2e34; --sh-studio: #d7a6f5; --sh-studio-soft: #33213f; --sh-ok: #5fd39b; --sh-warn: #f0b35a; --sh-bad: #ff8a80;
    --sh-office: #5eead4; --sh-office-soft: #16302d; }
}

/* the search box (in the console's top bar and in the bar below) */
.sh-search { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; height: 34px; padding: 0 12px; border-radius: 10px;
  background: var(--sh-field); color: var(--sh-muted); border: 1px solid transparent; font: inherit; font-size: 14px; }
.sh-search:focus-within { border-color: var(--sh-blue); background: var(--sh-bg); color: var(--sh-fg); }
.sh-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--sh-fg); font: inherit; }
.sh-search input::-webkit-search-cancel-button { cursor: pointer; }
.sh-pop { position: absolute; z-index: 60; top: calc(100% + 6px); right: 0; width: min(420px, calc(100vw - 24px)); display: grid; gap: 6px;
  padding: 14px 16px; border-radius: 12px; background: var(--sh-bg); color: var(--sh-fg); border: 1px solid var(--sh-line);
  box-shadow: 0 10px 30px rgba(20, 22, 28, .18); font-size: 13.5px; line-height: 1.45; text-align: left; }
.sh-pop[hidden] { display: none; }
.sh-pop b { font-size: 15px; overflow-wrap: anywhere; }
.sh-pop span { color: var(--sh-muted); }
.sh-pop ul { margin: 0; padding-left: 18px; color: var(--sh-fg); }
.sh-pop em { color: var(--sh-warn); font-style: normal; }
.sh-pop a { color: var(--sh-blue); font-weight: 600; text-decoration: none; }
.sh-pop a:hover { text-decoration: underline; }
.sh-pop .sh-verdict { color: var(--sh-fg); font-weight: 600; }
.sh-pop .sh-verdict.ok, .sh-pop .sh-verdict.green { color: var(--sh-ok); }
.sh-pop .sh-verdict.warn, .sh-pop .sh-verdict.amber, .sh-pop .sh-verdict.orange { color: var(--sh-warn); }
.sh-pop .sh-verdict.bad, .sh-pop .sh-verdict.red { color: var(--sh-bad); }

/* the bar of a page opened from the console: fixed on top; the page is moved down by its height, and what sticks to
   the top of the page sticks below it */
/* 2026-11-23: the console's own top bar (workspace.css draws the console's the same way) - the mark, the rooms with their
   pictures in one line, the search, who you are; 56 px, white, one hairline */
html.has-shellbar { --sb-h: 56px; padding-top: var(--sb-h); }
.shellbar { position: fixed; top: 0; left: 0; right: 0; z-index: 90; box-sizing: border-box; height: var(--sb-h, 56px); display: flex; align-items: center; gap: 16px;
  padding: 0 20px; background: var(--sh-bg); color: var(--sh-fg); border-bottom: 1px solid var(--sh-line);
  font: 14px/1.2 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
.shellbar a { text-decoration: none; }
.sb-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--sh-fg); }
.sb-logo b { font-weight: 800; letter-spacing: .18em; font-size: 15px; }
.sb-mark { width: 30px; height: 30px; flex: none; }
.sb-mark rect { fill: var(--sh-blue); } .sb-mark path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; } .sb-mark circle { fill: #fff; }
.shellbar nav { display: flex; gap: 4px; min-width: 0; margin-left: 8px; }
.sb-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 10px; color: var(--sh-muted); font-size: 15px; font-weight: 600; white-space: nowrap; }
.sb-tab:hover { background: var(--sh-field); color: var(--sh-fg); }
.sb-tab.on.today { background: var(--sh-today-soft); color: var(--sh-today); }
.sb-tab.on.wh { background: var(--sh-wh-soft); color: var(--sh-wh); }
.sb-tab.on.shop { background: var(--sh-shop-soft); color: var(--sh-shop); }
.sb-tab.on.adm { background: var(--sh-adm-soft); color: var(--sh-adm); }
.sb-tab.on.studio { background: var(--sh-studio-soft); color: var(--sh-studio); }
.sb-tab.on.office { background: var(--sh-office-soft); color: var(--sh-office); }
.shellbar a:focus-visible { outline: 2px solid var(--sh-blue); outline-offset: 2px; }
.sb-search { margin-left: auto; width: min(320px, 30vw); }
.shellbar .sh-search { height: 36px; }
.sb-me { color: var(--sh-fg); font-weight: 600; white-space: nowrap; padding: 6px 4px; }
/* 群聊 · 私信 (2026-11-24): a bubble in every top bar - the console's and the pages' of their own - with the unread count */
.sb-chat { display: inline-flex; flex: none; }
.sb-chat[hidden] { display: none; }
.sh-chat { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px;
  color: var(--sh-muted, #5b6068); text-decoration: none; }
.sh-chat:hover { background: var(--sh-field, #f1f2f5); color: var(--sh-fg, #1d1d1f); }
.sh-chat.on { background: var(--sh-office-soft, #e2f3f1); color: var(--sh-office, #0f766e); }
.sh-chat:focus-visible { outline: 2px solid var(--sh-blue, #2f4bd0); outline-offset: 2px; }
.sh-chat i { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px;
  background: #d93025; color: #fff; font: 700 11px/18px system-ui, sans-serif; font-style: normal; text-align: center; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--sh-bg, #fff); }
.sh-chat i[hidden] { display: none; }
@media (max-width: 1100px) { .sb-tab span { display: none; } .sb-tab { padding: 8px 10px; } }
@media (max-width: 640px) {
  .shellbar { gap: 8px; padding: 0 10px; }
  .sb-logo b, .sb-me { display: none; }
  .sb-tab { padding: 6px 8px; }
  .sb-search { display: none; }  /* a phone: the five rooms need the row; search lives in the console itself */
  .shellbar nav { margin-left: 0; }
}

/* a page of 管理 also gets 管理's menu on the left (shellbar.js), the same as the console's rail (workspace.css .ws-rail) */
.sb-rail { position: fixed; z-index: 80; top: var(--sb-h, 56px); left: 0; bottom: 0; width: 232px; box-sizing: border-box; overflow: auto;
  display: grid; align-content: start; gap: 2px; padding: 18px 10px; background: var(--sh-bg); border-right: 1px solid var(--sh-line);
  font: 14px/1.3 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
.sb-rail h3 { margin: 14px 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; color: var(--sh-muted); }
.sb-rail h3:first-child { margin-top: 0; }
.sb-rail a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--sh-fg); text-decoration: none; }
.sb-rail a:hover { background: var(--sh-field); }
.sb-rail .sh-ver { margin: 18px 10px 0; font-size: 11.5px; line-height: 1.45; color: var(--sh-muted); }
.sb-rail .sh-ver span { display: block; }
.sb-rail a.on { background: var(--sh-adm-soft); color: var(--sh-adm); font-weight: 600; }
.sb-rail.office a.on { background: var(--sh-office-soft); color: var(--sh-office); }
.sb-rail a:focus-visible { outline: 2px solid var(--sh-blue); outline-offset: -2px; }
html.has-sbrail { padding-left: 232px; }
@media (max-width: 999px) { .sb-rail { display: none; } html.has-sbrail { padding-left: 0; } }

/* the pages' own sticky headers stay in sight below the bar */
html.has-shellbar .top { top: var(--sb-h); }
html.has-shellbar .head { top: var(--sb-h); }
html.has-shellbar .group { top: calc(var(--head-h, 56px) + var(--sb-h)); }
html.has-shellbar #goods { top: calc(var(--head-h, 56px) + var(--sb-h)); max-height: calc(100vh - var(--head-h, 56px) - var(--sb-h) - 56px); }
html.has-shellbar body { min-height: calc(100vh - var(--sb-h)); }
