/* UX-00 银色商用设计系统 · 共享 shell（第一支切片仅在 body.ui-shell-pilot 生效）。
   本地系统字体、无远程资源、无网络/存储；深藏青旧壳在此明确让位于银白冷灰。 */
:root {
  --ui-shell-ink: #1c2128;
  --ui-shell-ink-muted: #5b6470;
  --ui-shell-sidebar-bg: #f2f3f5;
  --ui-shell-surface: #fbfcfd;
  --ui-shell-surface-raised: #ffffff;
  --ui-shell-border: #dcdfe4;
  --ui-shell-border-strong: #c6cad1;
  --ui-shell-accent: #5a5fd0;
  --ui-shell-accent-soft: #eceefb;
  --ui-shell-hover: #e7e9ee;
  --ui-shell-shadow: 0 8px 24px rgba(28, 33, 40, 0.08);
  --ui-shell-space-1: 4px;
  --ui-shell-space-2: 8px;
  --ui-shell-space-3: 12px;
  --ui-shell-space-4: 16px;
  --ui-shell-space-5: 20px;
  --ui-shell-space-6: 28px;
  --ui-shell-radius: 8px;
  --ui-shell-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

body.ui-shell-pilot {
  font-family: var(--ui-shell-font);
  color: var(--ui-shell-ink);
  background: var(--ui-shell-surface);
}

body.ui-shell-pilot .shell {
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

body.ui-shell-pilot .sidebar.ui-shell {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--ui-shell-space-3);
  width: 248px;
  height: auto;
  padding: var(--ui-shell-space-4);
  background: var(--ui-shell-sidebar-bg);
  color: var(--ui-shell-ink);
  border-right: 1px solid var(--ui-shell-border);
}

body.ui-shell-pilot .ui-shell-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-shell-space-2);
  padding-bottom: var(--ui-shell-space-3);
  border-bottom: 1px solid var(--ui-shell-border);
}

body.ui-shell-pilot .ui-shell-brand .brand {
  display: flex;
  align-items: center;
  gap: var(--ui-shell-space-2);
  color: var(--ui-shell-ink);
  font-size: 16px;
  text-decoration: none;
}

body.ui-shell-pilot .brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--ui-shell-radius);
  background: var(--ui-shell-accent);
  color: #ffffff;
  font-weight: 600;
}

body.ui-shell-pilot .ui-shell-brand-text strong { display: block; font-size: 16px; line-height: 20px; }
body.ui-shell-pilot .ui-shell-brand-text small { display: block; color: var(--ui-shell-ink-muted); font-size: 14px; line-height: 16px; }

body.ui-shell-pilot .ui-shell-nav { display: flex; flex-direction: column; gap: var(--ui-shell-space-1); }
body.ui-shell-pilot .ui-shell-nav a { color: var(--ui-shell-ink); }

body.ui-shell-pilot .ui-shell-group > summary,
body.ui-shell-pilot .ui-shell-subgroup > summary {
  display: flex;
  align-items: center;
  gap: var(--ui-shell-space-2);
  padding: var(--ui-shell-space-2);
  border-radius: var(--ui-shell-radius);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: var(--ui-shell-ink);
  cursor: pointer;
  list-style: none;
}

body.ui-shell-pilot .ui-shell-group > summary::-webkit-details-marker,
body.ui-shell-pilot .ui-shell-subgroup > summary::-webkit-details-marker { display: none; }

body.ui-shell-pilot .ui-shell-group > summary::after,
body.ui-shell-pilot .ui-shell-subgroup > summary::after {
  content: "";
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--ui-shell-ink-muted);
  border-bottom: 1.5px solid var(--ui-shell-ink-muted);
  transform: rotate(45deg);
  transition: transform 120ms ease;
}

body.ui-shell-pilot details[open] > summary::after { transform: rotate(135deg); }

body.ui-shell-pilot .ui-shell-group > summary:hover,
body.ui-shell-pilot .ui-shell-subgroup > summary:hover,
body.ui-shell-pilot .ui-shell-nav a:hover {
  background: var(--ui-shell-accent-soft);
  color: var(--ui-shell-accent);
}

body.ui-shell-pilot .ui-shell-group > summary:focus-visible,
body.ui-shell-pilot .ui-shell-subgroup > summary:focus-visible,
body.ui-shell-pilot .ui-shell-nav a:focus-visible,
body.ui-shell-pilot .ui-shell-menu-button:focus-visible,
body.ui-shell-pilot .ui-shell-collapse:focus-visible {
  outline: 2px solid var(--ui-shell-accent);
  outline-offset: 2px;
}

body.ui-shell-pilot .ui-shell-icon { flex: none; color: var(--ui-shell-ink-muted); }

body.ui-shell-pilot .ui-shell-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: var(--ui-shell-space-1) 0 var(--ui-shell-space-2);
  padding-left: var(--ui-shell-space-5);
  border-left: 1px solid var(--ui-shell-border);
}

body.ui-shell-pilot .ui-shell-subgroup { margin: var(--ui-shell-space-1) 0; }
body.ui-shell-pilot .ui-shell-subgroup > .ui-shell-links { padding-left: var(--ui-shell-space-4); }

body.ui-shell-pilot .ui-shell-nav a {
  display: block;
  padding: 6px var(--ui-shell-space-2);
  border-radius: 6px;
  border-left: 2px solid transparent;
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
}

body.ui-shell-pilot .ui-shell-nav a.active {
  background: var(--ui-shell-accent-soft);
  border-left-color: var(--ui-shell-accent);
  color: var(--ui-shell-accent);
  font-weight: 600;
}

body.ui-shell-pilot .ui-shell-subitem > a { font-size: 14px; }
body.ui-shell-pilot .ui-shell-note {
  margin: var(--ui-shell-space-1) 0 var(--ui-shell-space-2) var(--ui-shell-space-5);
  color: var(--ui-shell-ink-muted);
  font-size: 14px;
  line-height: 20px;
}

body.ui-shell-pilot .ui-shell-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-shell-space-2);
  margin-top: auto;
  padding-top: var(--ui-shell-space-3);
  border-top: 1px solid var(--ui-shell-border);
  font-size: 14px;
  color: var(--ui-shell-ink);
}

body.ui-shell-pilot .ui-shell-user { font-weight: 600; }

/* 顶栏与内容层：银白表面、细分隔、克制的层级 */
body.ui-shell-pilot .topbar {
  background: rgba(251, 252, 253, 0.9);
  border-bottom: 1px solid var(--ui-shell-border);
}

body.ui-shell-pilot main h1 { font-size: 28px; line-height: 36px; }
body.ui-shell-pilot main h2 { font-size: 20px; line-height: 28px; }
body.ui-shell-pilot main p, body.ui-shell-pilot main a, body.ui-shell-pilot main li { font-size: 16px; line-height: 24px; }
body.ui-shell-pilot .content table {
  border-collapse: collapse;
  background: var(--ui-shell-surface-raised);
  font-size: 14px;
}
body.ui-shell-pilot .content th, body.ui-shell-pilot .content td {
  border-bottom: 1px solid var(--ui-shell-border);
  padding: var(--ui-shell-space-2);
}

body.ui-shell-pilot .button,
body.ui-shell-pilot .link-button {
  min-height: 36px;
  padding: var(--ui-shell-space-2) var(--ui-shell-space-4);
  border: 1px solid var(--ui-shell-border-strong);
  border-radius: var(--ui-shell-radius);
  background: var(--ui-shell-surface-raised);
  color: var(--ui-shell-ink);
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(28, 33, 40, 0.05);
}

body.ui-shell-pilot .button:hover,
body.ui-shell-pilot .link-button:hover { border-color: var(--ui-shell-accent); color: var(--ui-shell-accent); }

body.ui-shell-pilot input[type="text"], body.ui-shell-pilot input[type="search"],
body.ui-shell-pilot input[type="date"], body.ui-shell-pilot input[type="number"],
body.ui-shell-pilot select {
  padding: var(--ui-shell-space-2);
  border: 1px solid var(--ui-shell-border-strong);
  border-radius: 6px;
  background: var(--ui-shell-surface-raised);
  font-size: 14px;
}

body.ui-shell-pilot .message { border-radius: var(--ui-shell-radius); font-size: 14px; }
body.ui-shell-pilot .status-ok { color: #157a47; }
body.ui-shell-pilot .status-warn { color: #9a6b00; }
body.ui-shell-pilot .status-error { color: #b4232c; }

/* 稀疏玻璃：opaque 兜底在前，支持才加模糊 */
body.ui-shell-pilot .ui-shell { background: var(--ui-shell-sidebar-bg); }
@supports (backdrop-filter: blur(6px)) {
  body.ui-shell-pilot .ui-shell {
    background: rgba(242, 243, 245, 0.86);
    backdrop-filter: blur(6px);
  }
}

body.ui-shell-pilot .ui-shell-dialog {
  padding: var(--ui-shell-space-5);
  border: 1px solid var(--ui-shell-border);
  border-radius: var(--ui-shell-radius);
  background: var(--ui-shell-surface-raised);
  box-shadow: var(--ui-shell-shadow);
  color: var(--ui-shell-ink);
  font-size: 14px;
}

/* 导航开关与抽屉：JS 在场才启用抽屉行为；无 JS 时侧栏留在文档流内可达 */
body.ui-shell-pilot .ui-shell-menu-button {
  display: none;
  position: fixed;
  top: var(--ui-shell-space-3);
  left: var(--ui-shell-space-3);
  z-index: 40;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ui-shell-border-strong);
  border-radius: var(--ui-shell-radius);
  background: var(--ui-shell-surface-raised);
  color: var(--ui-shell-ink);
  box-shadow: var(--ui-shell-shadow);
}

body.ui-shell-pilot .ui-shell-collapse {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ui-shell-ink-muted);
}

body.ui-shell-pilot .ui-shell-collapse:hover { border-color: var(--ui-shell-border-strong); color: var(--ui-shell-accent); }

body.ui-shell-pilot .ui-shell-scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(28, 33, 40, 0.32);
}

body.ui-shell-pilot:not(.ui-shell-js) .ui-shell-collapse { display: none; }

@media (min-width: 1025px) {
  body.ui-shell-pilot.ui-shell-nav-collapsed .shell { grid-template-columns: 64px minmax(0, 1fr); }
  body.ui-shell-pilot.ui-shell-nav-collapsed .sidebar.ui-shell { width: 64px; padding: var(--ui-shell-space-2); }
  body.ui-shell-pilot.ui-shell-nav-collapsed .ui-shell-brand-text,
  body.ui-shell-pilot.ui-shell-nav-collapsed .ui-shell-group > summary span,
  body.ui-shell-pilot.ui-shell-nav-collapsed .ui-shell-subgroup > summary span,
  body.ui-shell-pilot.ui-shell-nav-collapsed .ui-shell-user,
  body.ui-shell-pilot.ui-shell-nav-collapsed .ui-shell-account form { display: none; }
  body.ui-shell-pilot.ui-shell-nav-collapsed .ui-shell-links {
    padding-left: 0;
    border-left: 0;
  }
  body.ui-shell-pilot.ui-shell-nav-collapsed .ui-shell-nav a {
    overflow: hidden;
    max-width: 48px;
    white-space: nowrap;
    text-indent: -9999px;
  }
  body.ui-shell-pilot.ui-shell-nav-collapsed .ui-shell-collapse { transform: rotate(180deg); }
}

@media (max-width: 1024px) {
  body.ui-shell-pilot .shell { grid-template-columns: minmax(0, 1fr); }
  body.ui-shell-pilot:not(.ui-shell-js) .sidebar.ui-shell {
    position: static;
    width: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--ui-shell-border);
  }
  body.ui-shell-pilot.ui-shell-js .sidebar.ui-shell {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 35;
    height: 100vh;
    max-height: 100vh;
    transform: translateX(-100%);
    transition: transform 160ms ease;
    box-shadow: none;
  }
  body.ui-shell-pilot.ui-shell-js .ui-shell-menu-button { display: flex; }
  body.ui-shell-pilot.ui-shell-js .ui-shell-collapse { display: none; }
  body.ui-shell-pilot.ui-shell-nav-open .sidebar.ui-shell {
    transform: translateX(0);
    box-shadow: var(--ui-shell-shadow);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.ui-shell-pilot details > summary::after,
  body.ui-shell-pilot .sidebar.ui-shell { transition: none; }
}

/* ==== LZH28 视觉系统精修（仅 body.ui-shell-pilot 生效；上方 :root 令牌与全部
   几何 / 抽屉 / 玻璃 / 层级契约逐字节保留，此处只做层级、留白与选中质感） ==== */

/* 在试点根重定义材质层：冷灰环境底 / 抬起表面 / 极细低对比分隔 / 稀疏选中染色。
   :root 旧定义不动，这里在试点作用域内覆盖，未授权页面零受影响。 */
body.ui-shell-pilot {
  --ui-shell-canvas: #eef1f5;
  --ui-shell-elevated: #ffffff;
  --ui-shell-hairline: #e7ebf0;
  --ui-shell-selected: rgba(90, 95, 208, 0.08);
  --ui-shell-shadow-quiet: 0 1px 2px rgba(28, 33, 40, 0.05);
}

/* 内容区铺冷灰环境底，工作台成为其上的抬起主区，形成画布 / 表面层级而非等重白块。 */
body.ui-shell-pilot main { background: var(--ui-shell-canvas); }
body.ui-shell-pilot .content { padding: var(--ui-shell-space-6); }

/* 侧栏：有意义的全高（人控贴底、导航在上），选中行细描边而非整块灰底、克制的行过渡。 */
body.ui-shell-pilot .sidebar.ui-shell { min-height: 100vh; }
body.ui-shell-pilot .ui-shell-nav a {
  transition: background 120ms ease, color 120ms ease, border-left-color 120ms ease;
}
body.ui-shell-pilot .ui-shell-group > summary,
body.ui-shell-pilot .ui-shell-subgroup > summary { color: var(--ui-shell-ink); }
body.ui-shell-pilot .ui-shell-group > summary:hover,
body.ui-shell-pilot .ui-shell-subgroup > summary:hover {
  background: var(--ui-shell-selected);
  color: var(--ui-shell-accent);
}

/* 顶栏：编辑式标题条——细底边、克制留白、明确字号层级，不与页面正文等重。 */
body.ui-shell-pilot .topbar {
  min-height: 0;
  padding: var(--ui-shell-space-5) var(--ui-shell-space-6);
  background: var(--ui-shell-surface);
}
body.ui-shell-pilot .topbar h1 { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; }
body.ui-shell-pilot .topbar p { margin: 4px 0 0; color: var(--ui-shell-ink-muted); font-size: 14px; line-height: 20px; }

/* 焦点可见性：单一强调色、2px 外环、对比可达；不依赖 hover 才出现信息。 */
body.ui-shell-pilot a:focus-visible,
body.ui-shell-pilot button:focus-visible,
body.ui-shell-pilot .button:focus-visible,
body.ui-shell-pilot .link-button:focus-visible,
body.ui-shell-pilot summary:focus-visible {
  outline: 2px solid var(--ui-shell-accent);
  outline-offset: 2px;
}

/* 系统控件：抬起表面、柔和扩散阴影，替代处处等重的粗描边卡片。 */
body.ui-shell-pilot .button,
body.ui-shell-pilot .link-button {
  border-color: var(--ui-shell-hairline);
  background: var(--ui-shell-elevated);
  box-shadow: var(--ui-shell-shadow-quiet);
}

@media (prefers-reduced-motion: reduce) {
  body.ui-shell-pilot .ui-shell-nav a { transition: none; }
}

/* Codex order pilot: local material and navigation refinement. Historical rules above stay intact. */
body.ui-shell-pilot {
  --ui-shell-ink: #182440;
  --ui-shell-ink-muted: #596784;
  --ui-shell-sidebar-bg: #f2f5fc;
  --ui-shell-canvas: #f4f6fb;
  --ui-shell-accent: #4654cf;
  --ui-shell-accent-soft: #e9edff;
  --ui-shell-hairline: #e3e8f2;
  -webkit-font-smoothing: antialiased;
}
body.ui-shell-pilot .shell { grid-template-columns: 224px minmax(0, 1fr); }
body.ui-shell-pilot main {
  background: linear-gradient(135deg, #edf1fc 0, #f8faff 42%, #f2f5fa 100%);
}
body.ui-shell-pilot .sidebar.ui-shell {
  width: 224px;
  padding: 24px 16px 18px;
  border-right-color: #e4eaf5;
  box-shadow: 4px 0 24px rgba(40, 58, 108, 0.025);
}
body.ui-shell-pilot .ui-shell-brand { padding-bottom: 22px; border-bottom-color: #dfe5f1; }
body.ui-shell-pilot .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(145deg, #7d88ee, #4654bd);
  box-shadow: 0 4px 10px rgba(70, 84, 189, 0.16);
}
body.ui-shell-pilot .ui-shell-brand-text strong { font-size: 15px; line-height: 22px; }
body.ui-shell-pilot .ui-shell-brand-text small { font-size: 12px; line-height: 18px; }
body.ui-shell-pilot .sidebar .ui-shell-nav { margin-top: 12px; gap: 8px; }
body.ui-shell-pilot .ui-shell-group > summary { min-height: 42px; font-weight: 500; }
body.ui-shell-pilot .ui-shell-icon { color: #627197; }
body.ui-shell-pilot .ui-shell-links { margin-left: 8px; padding-left: 12px; border-left-color: #dce3f2; }
body.ui-shell-pilot .ui-shell-nav a { padding: 9px 10px; color: #465575; }
body.ui-shell-pilot .ui-shell-nav a.active {
  color: #3444bc;
  background: linear-gradient(100deg, #e1e8ff, #edf1ff);
  border-left-color: #5263e0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
body.ui-shell-pilot .topbar {
  gap: 16px;
  padding: 20px clamp(24px, 3vw, 48px);
  background: #f8faff;
  border-bottom-color: #e4eaf5;
}
body.ui-shell-pilot .topbar > div { min-width: 0; }
body.ui-shell-pilot .topbar h1 { font-size: 18px; line-height: 26px; }
body.ui-shell-pilot .topbar p { max-width: 76ch; overflow-wrap: anywhere; font-size: 13px; }
body.ui-shell-pilot .topbar > .button { flex: none; font-size: 13px; }
body.ui-shell-pilot .content { padding: 28px clamp(24px, 3vw, 48px) 48px; }
body.ui-shell-pilot .button, body.ui-shell-pilot .link-button {
  border-radius: 10px;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
body.ui-shell-pilot .button:hover, body.ui-shell-pilot .link-button:hover {
  background: #f6f8ff;
  box-shadow: 0 3px 10px rgba(39, 58, 111, 0.08);
}
body.ui-shell-pilot :focus-visible { outline: 2px solid #3444bc; outline-offset: 3px; }
@media (min-width: 1025px) {
  body.ui-shell-pilot.ui-shell-nav-collapsed .shell { grid-template-columns: 64px minmax(0, 1fr); }
  body.ui-shell-pilot.ui-shell-nav-collapsed .sidebar.ui-shell { width: 64px; padding: 12px 8px; }
}
@media (max-width: 1024px) {
  body.ui-shell-pilot .shell { grid-template-columns: minmax(0, 1fr); }
  body.ui-shell-pilot:not(.ui-shell-js) .sidebar.ui-shell { width: auto; min-height: 0; }
  body.ui-shell-pilot.ui-shell-js .topbar { padding-left: 72px; }
  body.ui-shell-pilot .content { padding: 20px 20px 32px; }
}
@media (max-width: 600px) {
  body.ui-shell-pilot .topbar { flex-wrap: wrap; padding: 18px 20px; }
  body.ui-shell-pilot .content { padding: 18px 14px 28px; }
}
@media (prefers-reduced-motion: reduce) {
  body.ui-shell-pilot .button, body.ui-shell-pilot .link-button { transition: none; }
}
@media (forced-colors: active) {
  body.ui-shell-pilot .ui-shell-nav a.active { outline: 1px solid Highlight; }
  body.ui-shell-pilot :focus-visible { outline-color: Highlight; }
}

/* Bounded order refinement: reclaim first-fold space only on the existing workbench. */
@media (min-width: 1200px) {
  body.ui-shell-pilot:has(.workbench[data-ux03]) .topbar {
    padding-top: 13px;
    padding-bottom: 13px;
  }
  body.ui-shell-pilot:has(.workbench[data-ux03]) .content {
    padding-top: 18px;
  }
}
