/* 跃界统一壳层 · 20261021-shell2
   仅挂在带 data-yuejie-shell / .yuejie-shell / body.member-space / .workbench-page / .workbench-hub / .admin-app / .spatial-auth 的页面，
   不用全局 * 选择器，避免波及资料目录等未改造业务。 */
:root {
  --yj-space: 8px;
  --yj-radius: 14px;
  --yj-radius-sm: 10px;
  --yj-radius-pill: 999px;
  --yj-touch: 44px;
  --yj-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --yj-title: 600;
  --yj-safe-b: env(safe-area-inset-bottom, 0px);
  --yj-safe-t: env(safe-area-inset-top, 0px);
}

html[data-yuejie-shell],
body.yuejie-shell,
body.member-space,
body.workbench-page,
body.spatial-auth,
.admin-app {
  font-family: var(--yj-font);
  -webkit-font-smoothing: antialiased;
}

/* —— 基础控件（作用域内） —— */
.yuejie-shell .yj-btn,
body.member-space .primary-button,
body.member-space .outline-button,
body.workbench-page .primary-button,
body.workbench-page .outline-button,
.admin-app .button {
  min-height: var(--yj-touch);
  border-radius: var(--yj-radius-sm);
  font-weight: 550;
  letter-spacing: 0;
}

.yuejie-shell .yj-field,
body.member-space .member-card-actions,
body.workbench-page .search-box,
.admin-app .curation-search,
.admin-app input,
.admin-app select,
.admin-app textarea {
  font-family: inherit;
}

body.workbench-page .search-box,
body.member-space .yj-search,
.admin-app .member-toolbar .curation-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--yj-touch);
  padding: 0 14px;
  border: 1px solid var(--hub-line, var(--line));
  border-radius: var(--yj-radius-pill);
  background: var(--hub-surface, var(--surface));
}

body.workbench-page .search-box input,
.admin-app .member-toolbar .curation-search input {
  min-height: 40px;
  border: 0;
  background: transparent;
  width: 100%;
  outline: 0;
}

.yj-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.yj-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--yj-touch);
  padding: 0 14px;
  border: 1px solid var(--hub-line, var(--line));
  border-radius: var(--yj-radius-pill);
  background: transparent;
  color: inherit;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
/* 图标可小于 44，点击热区仍满触控高度 */
.hub-header .theme-button {
  width: var(--yj-touch);
  height: var(--yj-touch);
  min-width: var(--yj-touch);
  min-height: var(--yj-touch);
}
.hub-header .theme-button svg {
  width: 18px;
  height: 18px;
}

.yj-chip.is-primary {
  background: var(--accent, var(--hub-accent));
  color: #fff;
  border-color: transparent;
}

.yj-chip.is-muted {
  color: var(--hub-muted, var(--muted));
  cursor: default;
}

.yj-feedback {
  font-size: 12px;
  line-height: 1.6;
  min-height: 1.2em;
}
.yj-feedback.is-ok,
.message-success { color: #2f7a4a; }
.yj-feedback.is-err,
.message-error { color: #b42318; }
html[data-theme=dark] .yj-feedback.is-ok,
html[data-theme=dark] .message-success { color: #8fd4a4; }
html[data-theme=dark] .yj-feedback.is-err,
html[data-theme=dark] .message-error { color: #f3a59e; }

.yj-empty {
  padding: 28px 18px;
  border: 1px dashed var(--hub-line, var(--line));
  border-radius: var(--yj-radius);
  color: var(--hub-muted, var(--muted));
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.yj-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: var(--yj-radius-pill);
  background: var(--hub-soft, var(--elevated));
  color: var(--hub-muted, var(--muted));
  font-size: 11px;
}

/* —— 顶栏 CTA：工作台 —— */
.hub-nav .header-cta {
  min-height: 40px;
  gap: 10px;
  border-radius: var(--yj-radius-sm);
}
.hub-nav .header-account {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--hub-muted);
}

/* —— 员工：我的项目 —— */
body.member-space .member-space-shell {
  min-height: calc(100dvh - 88px);
}
body.member-space .member-identity strong {
  overflow-wrap: anywhere;
  white-space: normal;
}
body.member-space .member-identity small {
  letter-spacing: 0.04em;
}
body.member-space .member-space-cards {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}
body.member-space .member-space-cards article {
  border-radius: 20px;
  display: flex;
  flex-direction: column;
}
body.member-space .member-card-copy {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px;
}
body.member-space .member-card-copy h2 {
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 600;
  letter-spacing: -0.3px;
  overflow-wrap: anywhere;
  margin: 8px 0 10px;
}
body.member-space .member-card-actions {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
body.member-space .member-card-actions .primary-button,
body.member-space .member-card-actions .outline-button {
  min-height: var(--yj-touch);
  padding: 0 16px;
}
body.member-space .member-dock {
  display: none;
}

/* —— 管理员工作台文案层级 —— */
body.workbench-page .sidebar-section {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: none;
}
body.workbench-page .space-identity strong {
  white-space: normal;
  overflow-wrap: anywhere;
}
body.workbench-page .desk-topbar {
  letter-spacing: 0.02em;
}
body.workbench-page .project-card .card-link-line {
  flex-wrap: wrap;
  gap: 8px 12px;
  pointer-events: auto;
}
body.workbench-page .project-card .yj-chip-row {
  pointer-events: auto;
  position: relative;
  z-index: 4;
  margin-top: 10px;
}
body.workbench-page .desk-message:not(:empty) {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--yj-radius-sm);
  background: var(--hub-soft);
  font-size: 13px;
}

/* —— 后台：找人与保存 —— */
.admin-app .admin-label {
  letter-spacing: 0.06em;
}
.admin-app .member-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 12px 0;
  margin-bottom: 12px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px);
}
.admin-app .permission-account {
  scroll-margin-top: 72px;
}
.admin-app .user-identity strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}
.admin-app .user-save-message {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  min-height: 1.2em;
}
/* 操作区跟文档流，避免手机 sticky 盖住账号级别/勾选/核对（Z3）。 */
.admin-app .permission-account .row-actions {
  position: static;
  z-index: auto;
  margin-top: 4px;
  padding: 12px 0 0;
  background: transparent;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-app .permission-account.is-filtered-out {
  display: none !important;
}
.admin-app .permission-account[hidden] {
  display: none !important;
}
.admin-app .member-filter-count {
  font-size: 12px;
  color: var(--muted);
}

/* —— 登录 —— */
body.spatial-auth .auth-submit {
  min-height: 52px;
  border-radius: 12px;
}
body.spatial-auth .auth-message:not(:empty) {
  margin-top: 10px;
  font-size: 13px;
}

/* —— 窄窗与手机 —— */
@media (max-width: 800px) {
  body.workbench-page .desk-nav,
  body.member-space .member-space-sidebar nav a {
    min-height: var(--yj-touch);
  }
  body.workbench-page .desk-main,
  body.member-space .member-space-content {
    padding-bottom: calc(24px + var(--yj-safe-b));
  }
  body.member-space .member-space-sidebar nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  body.member-space .member-space-sidebar nav::-webkit-scrollbar { display: none; }
  .admin-app .member-toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .admin-app .member-toolbar .curation-search {
    min-width: 100%;
    max-width: none;
  }
  .admin-app .permission-account .row-actions .button {
    flex: 1 1 calc(50% - 6px);
    min-height: var(--yj-touch);
  }
  .admin-app .admin-theme {
    min-width: var(--yj-touch);
    min-height: var(--yj-touch);
    width: auto;
    height: auto;
    padding: 0;
  }
  .admin-app .account-segments button {
    min-height: var(--yj-touch);
  }
  .admin-app .permission-role select {
    min-height: var(--yj-touch);
  }
}

@media (max-width: 560px) {
  body.member-space {
    padding-bottom: calc(64px + var(--yj-safe-b));
  }
  body.member-space .member-dock {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 6px 8px calc(6px + var(--yj-safe-b));
    background: color-mix(in srgb, var(--hub-surface) 92%, transparent);
    border-top: 1px solid var(--hub-line);
    backdrop-filter: blur(16px);
  }
  body.member-space .member-dock a,
  body.member-space .member-dock button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 52px;
    border: 0;
    background: transparent;
    color: var(--hub-muted);
    font-size: 12px;
    line-height: 1.2;
    text-decoration: none;
  }
  body.member-space .member-dock a.is-active,
  body.member-space .member-dock button.is-active {
    color: var(--hub-accent, var(--yj-accent, #007aff));
    font-weight: 650;
  }
  body.member-space .member-dock svg {
    width: 22px;
    height: 22px;
  }
  body.workbench-page .project-grid {
    grid-template-columns: 1fr;
  }
  body.workbench-page .desk-heading {
    flex-direction: column;
    align-items: stretch;
  }
  body.workbench-page .desk-heading > .primary-button {
    width: 100%;
    justify-content: center;
  }
  .hub-nav .header-account { display: none; }
}

@media (max-width: 430px) {
  body.member-space .member-card-copy,
  body.workbench-page .desk-main {
    padding-left: 16px;
    padding-right: 16px;
  }
  body.spatial-auth .auth-form-wrap {
    padding-inline: 4px;
  }
}

@media (max-width: 360px) {
  body.member-space .member-card-actions .primary-button {
    width: 100%;
  }
  .admin-app .account-segments button {
    padding: 0 8px;
    font-size: 11px;
  }
}

@media (max-width: 320px) {
  .hub-wrap { padding-inline: 12px; }
  body.workbench-page .desk-main { padding-inline: 12px; }
  body.member-space .member-space-content { padding-inline: 12px; }
}

/* —— shell2：工作台页 —— */
.yj-workbench {
  max-width: 920px;
  margin: 0 auto;
  padding: 36px clamp(18px, 4vw, 48px) calc(40px + var(--yj-safe-b));
}
.yj-workbench-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.yj-workbench-head h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.5px;
  margin: 8px 0 10px;
}
.yj-workbench-head p {
  max-width: 560px;
  color: var(--hub-muted);
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
}
.yj-workbench-grid {
  display: grid;
  gap: 16px;
}
.yj-work-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.yj-work-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: var(--yj-touch);
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: color-mix(in srgb, var(--hub-soft) 70%, transparent);
  border: 1px solid var(--hub-line);
}
.yj-work-list a strong {
  font-size: 14px;
  font-weight: 600;
}
.yj-work-list a span {
  flex: none;
  font-size: 12px;
  color: var(--hub-muted);
}
.yj-work-card {
  border: 1px solid var(--hub-line);
  border-radius: 18px;
  background: var(--hub-surface);
  padding: 22px 22px 20px;
}
.yj-work-card h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 6px 0 8px;
}
.yj-work-card > p {
  color: var(--hub-muted);
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 4px;
}
.yj-progress {
  font-size: 12px !important;
  color: var(--hub-muted) !important;
  margin: 8px 0 0 !important;
}
.yj-projects-head h1 {
  font-size: clamp(26px, 3.5vw, 36px);
  font-weight: 600;
  margin: 8px 0 10px;
}
.yj-projects-head p {
  color: var(--hub-muted);
  font-size: 13px;
  line-height: 1.75;
  max-width: 640px;
  margin-bottom: 28px;
}

/* —— shell2：手机顶栏与密度（S2） —— */
@media (max-width: 800px) {
  .hub-header .hub-nav {
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand actions" "links links";
    gap: 10px 12px;
    padding: 12px 16px calc(10px + var(--yj-safe-t));
    align-items: center;
  }
  .hub-header .hub-brand { grid-area: brand; }
  .hub-header .hub-links {
    grid-area: links;
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .hub-header .hub-links::-webkit-scrollbar { display: none; }
  .hub-header .hub-links a {
    flex: 0 0 auto;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    font-size: 13px;
    line-height: 1.2;
    padding: 10px 12px;
    min-height: var(--yj-touch);
    display: inline-flex;
    align-items: center;
    border-radius: 10px;
  }
  .hub-header .top-actions {
    grid-area: actions;
    margin-left: 0;
    gap: 8px;
  }
  .hub-header .nav-agent { display: none; }
  .hub-header .header-cta {
    min-height: var(--yj-touch);
    padding: 0 12px;
    font-size: 13px;
  }
  /* 员工项目：手机用底栏，收起重复侧栏 */
  body.member-space .member-space-sidebar,
  body.workbench-hub .member-space-sidebar {
    display: none;
  }
  body.member-space .member-space-shell,
  body.workbench-hub .member-space-shell {
    display: block;
  }
  body.member-space .member-space-content {
    padding: 24px 18px 28px;
  }
  body.member-space .member-space-content h1,
  body.member-space .yj-projects-head h1 {
    font-size: 28px;
    margin-top: 4px;
  }
  body.member-space .member-credit-orb { display: none; }
  /* 管理区侧栏：解除 hub inset/fixed 拉高；展开菜单不可被 overflow 裁切，且须压过 desk-body/顶栏 */
  body.workbench-page.spatial-workspace .desk-sidebar,
  body.workbench-page .desk-sidebar {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    align-content: center;
    gap: 8px;
    padding: 8px 12px !important;
    overflow: visible !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--hub-line);
    z-index: 70 !important;
  }
  body.workbench-page .desk-sidebar nav {
    display: flex !important;
    flex: 1 1 auto;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    align-content: center;
    gap: 6px;
    margin: 0 !important;
    min-width: 0;
    min-height: 0 !important;
    height: auto !important;
    /* 外层必须 visible：overflow-x:auto 会把 y 也算成 auto，裁掉展开菜单 */
    overflow: visible !important;
  }
  body.workbench-page .desk-nav-scroll {
    display: flex;
    flex: 1 1 0;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    min-height: var(--yj-touch);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  body.workbench-page .desk-nav,
  body.workbench-page .desk-sidebar nav a.desk-nav,
  body.workbench-page .desk-nav-more > summary {
    flex: 0 0 auto !important;
    align-self: center !important;
    white-space: nowrap;
    writing-mode: horizontal-tb !important;
    min-height: var(--yj-touch) !important;
    height: auto !important;
    max-height: none !important;
    padding: 8px 12px !important;
    font-size: 13px;
    align-items: center;
    line-height: 1.2;
  }
  body.workbench-page .desk-nav-more {
    position: relative;
    flex: 0 0 auto;
    flex-shrink: 0;
    align-self: center;
    display: flex;
    align-items: center;
    min-height: var(--yj-touch);
    height: auto;
    margin: 0;
    z-index: 80;
  }
  body.workbench-page .desk-nav-more > summary {
    list-style: none;
    cursor: pointer;
    border-radius: 11px;
    background: var(--hub-soft, transparent);
  }
  body.workbench-page .desk-nav-more > summary::-webkit-details-marker { display: none; }
  /* 单一面板承载子项，避免每个子按钮叠在同一绝对坐标 */
  body.workbench-page .desk-nav-more-panel {
    display: none;
  }
  body.workbench-page .desk-nav-more[open] > .desk-nav-more-panel {
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* 默认相对触发项；窄屏由 projects.js 改为 fixed 并钳位 left≥边距 */
    position: absolute;
    left: auto;
    right: 0;
    top: calc(100% + 6px);
    z-index: 90;
    width: min(18rem, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: min(60vh, 360px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 8px;
    border-radius: 12px;
    background: var(--hub-surface);
    border: 1px solid var(--hub-line);
    box-shadow: 0 12px 32px #18201f24;
    box-sizing: border-box;
  }
  body.workbench-page .desk-nav-more[open] > .desk-nav-more-panel > .desk-nav {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 100%;
    justify-content: flex-start;
  }
  body.workbench-page .sidebar-bottom {
    display: flex !important;
    flex: 0 0 auto;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0 4px !important;
    align-self: center;
    min-height: var(--yj-touch);
  }
  body.workbench-page .sidebar-bottom > .text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--yj-touch);
    min-height: var(--yj-touch);
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.2;
  }
  body.workbench-page .desk-body { margin-left: 0 !important; }
  body.workbench-page .space-identity,
  body.workbench-page .sidebar-section,
  body.workbench-page .permission-note {
    display: none !important;
  }
  .yj-workbench-head {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-app .role-guide {
    display: none;
  }
  .admin-app .permission-account details.project-permissions:not([open]) summary {
    min-height: var(--yj-touch);
    display: flex;
    align-items: center;
  }
}

@media (max-width: 560px) {
  body.workbench-hub {
    padding-bottom: calc(64px + var(--yj-safe-b));
  }
  body.workbench-hub .member-dock {
    display: grid;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.member-space *,
  body.workbench-page *,
  body.workbench-hub *,
  .admin-app * {
    animation: none !important;
    transition: none !important;
  }
}

/* —— 滚动条：手机隐藏常驻条仍可滑；电脑细条可拖；禁止用 overflow:hidden 裁掉可滚内容 —— */
html[data-yuejie-shell],
body.yuejie-shell,
body.member-space,
body.workbench-page,
body.workbench-hub,
body.spatial-auth,
.admin-app {
  -webkit-overflow-scrolling: touch;
}

/* 电脑：细滚动条（页面、侧栏横滑、弹层/菜单面板） */
@media (hover: hover) and (pointer: fine) {
  html[data-yuejie-shell],
  body.yuejie-shell,
  body.member-space,
  body.workbench-page,
  body.workbench-hub,
  .admin-app,
  body.workbench-page .desk-sidebar nav,
  body.workbench-page .desk-nav-scroll,
  body.workbench-page .desk-nav-more-panel,
  body.member-space .member-space-sidebar nav,
  .hub-header .hub-links,
  .project-detail-scroll,
  .spatial-workspace .project-detail-dialog .project-detail-scroll,
  dialog .dialog-sheet,
  dialog[open] {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--hub-line, #c5cdc6) 85%, transparent) transparent;
  }
  html[data-yuejie-shell]::-webkit-scrollbar,
  body.yuejie-shell::-webkit-scrollbar,
  body.member-space::-webkit-scrollbar,
  body.workbench-page::-webkit-scrollbar,
  body.workbench-hub::-webkit-scrollbar,
  .admin-app::-webkit-scrollbar,
  body.workbench-page .desk-sidebar nav::-webkit-scrollbar,
  body.workbench-page .desk-nav-scroll::-webkit-scrollbar,
  body.workbench-page .desk-nav-more-panel::-webkit-scrollbar,
  body.member-space .member-space-sidebar nav::-webkit-scrollbar,
  .hub-header .hub-links::-webkit-scrollbar,
  .project-detail-scroll::-webkit-scrollbar,
  dialog .dialog-sheet::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  html[data-yuejie-shell]::-webkit-scrollbar-thumb,
  body.yuejie-shell::-webkit-scrollbar-thumb,
  body.member-space::-webkit-scrollbar-thumb,
  body.workbench-page::-webkit-scrollbar-thumb,
  body.workbench-hub::-webkit-scrollbar-thumb,
  .admin-app::-webkit-scrollbar-thumb,
  body.workbench-page .desk-sidebar nav::-webkit-scrollbar-thumb,
  body.workbench-page .desk-nav-scroll::-webkit-scrollbar-thumb,
  body.workbench-page .desk-nav-more-panel::-webkit-scrollbar-thumb,
  body.member-space .member-space-sidebar nav::-webkit-scrollbar-thumb,
  .hub-header .hub-links::-webkit-scrollbar-thumb,
  .project-detail-scroll::-webkit-scrollbar-thumb,
  dialog .dialog-sheet::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--hub-line, #c5cdc6) 80%, transparent);
    border-radius: 999px;
  }
  html[data-yuejie-shell]::-webkit-scrollbar-track,
  body.yuejie-shell::-webkit-scrollbar-track,
  body.member-space::-webkit-scrollbar-track,
  body.workbench-page::-webkit-scrollbar-track,
  body.workbench-hub::-webkit-scrollbar-track,
  .admin-app::-webkit-scrollbar-track,
  body.workbench-page .desk-nav-scroll::-webkit-scrollbar-track,
  body.workbench-page .desk-nav-more-panel::-webkit-scrollbar-track,
  .project-detail-scroll::-webkit-scrollbar-track,
  dialog .dialog-sheet::-webkit-scrollbar-track {
    background: transparent;
  }
}

/* 手机窄屏与触控：隐藏常驻滚动条，保留 overflow 可滚与惯性（含横滑内层、工作安排、后台根） */
@media (max-width: 800px), (hover: none), (pointer: coarse) {
  html[data-yuejie-shell],
  html:has(body[data-yuejie-shell]),
  html:has(.admin-app),
  html.page-meeting-tasks-root,
  body.yuejie-shell,
  body.member-space,
  body.workbench-page,
  body.workbench-hub,
  body.page-meeting-tasks,
  .admin-app,
  body.workbench-page .desk-sidebar nav,
  body.workbench-page .desk-nav-scroll,
  body.workbench-page .desk-nav-more-panel,
  body.member-space .member-space-sidebar nav,
  .hub-header .hub-links,
  .project-detail-scroll,
  body.page-meeting-tasks .tabs,
  body.page-meeting-tasks .category-tabs,
  body.page-meeting-tasks .manage-tasks,
  body.page-meeting-tasks .people-picker-list,
  body.page-meeting-tasks .people-picker-selected,
  dialog .dialog-sheet {
    scrollbar-width: none !important;
  }
  html[data-yuejie-shell]::-webkit-scrollbar,
  body.yuejie-shell::-webkit-scrollbar,
  body.member-space::-webkit-scrollbar,
  body.workbench-page::-webkit-scrollbar,
  body.workbench-hub::-webkit-scrollbar,
  .admin-app::-webkit-scrollbar,
  body.workbench-page .desk-sidebar nav::-webkit-scrollbar,
  body.workbench-page .desk-nav-scroll::-webkit-scrollbar,
  body.workbench-page .desk-nav-more-panel::-webkit-scrollbar,
  body.member-space .member-space-sidebar nav::-webkit-scrollbar,
  .hub-header .hub-links::-webkit-scrollbar,
  .project-detail-scroll::-webkit-scrollbar,
  dialog .dialog-sheet::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }
}

/* —— shell2v1/v2：顶栏跨页统一（V-F / V2-03） —— */
@media (max-width: 800px) {
  .hub-header .hub-brand {
    font-size: 20px !important;
    letter-spacing: 1px;
    font-weight: 700;
  }
  .hub-header .hub-brand small {
    display: none !important;
  }
  .hub-header .brand-mark {
    width: 32px !important;
    height: 32px !important;
  }
  .hub-header .theme-button,
  .hub-header [data-theme-toggle] {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
    min-height: 44px;
    font-size: 0;
  }
  .hub-nav .header-cta,
  .hub-header .header-cta {
    background: transparent !important;
    color: var(--hub-ink) !important;
    border: 1px solid var(--hub-line);
    border-radius: 10px;
    box-shadow: none !important;
    min-height: var(--yj-touch);
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
    gap: 8px;
  }
  .hub-nav .header-cta .account-orb,
  .hub-header .header-cta .account-orb {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    display: inline-block;
    background: var(--hub-soft, #eef1f4);
    border: 1px solid var(--hub-line);
  }
  .hub-nav .header-cta:hover,
  .hub-header .header-cta:hover {
    background: var(--hub-soft) !important;
    color: var(--hub-accent) !important;
    transform: none;
  }
  .hub-header .top-actions {
    align-items: center;
    gap: 8px;
  }
}

/* —— shell2v1：主题图标昼夜（V-E） —— */
.theme-button .icon-moon,
.admin-theme .icon-moon,
[data-theme-toggle] .icon-moon { display: none; }
.theme-button .icon-sun,
.admin-theme .icon-sun,
[data-theme-toggle] .icon-sun { display: block; }
html[data-theme=dark] .theme-button .icon-sun,
html[data-theme=dark] .admin-theme .icon-sun,
html[data-theme=dark] [data-theme-toggle] .icon-sun { display: none; }
html[data-theme=dark] .theme-button .icon-moon,
html[data-theme=dark] .admin-theme .icon-moon,
html[data-theme=dark] [data-theme-toggle] .icon-moon { display: block; }
/* 统一线框；旧 spatial 样式的实心填充和旋转不能影响主题图标。 */
.theme-button svg,
.admin-theme svg,
[data-theme-toggle] svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.theme-button,
.admin-theme,
[data-theme-toggle] { display: inline-grid; place-items: center; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; flex-shrink: 0; }
html[data-theme] [data-theme-toggle] svg { fill: none; stroke-width: 1.75; }
.theme-button:hover,
html[data-theme] [data-theme-toggle]:hover { transform: none; }

/* —— shell2v1：工作台手机优先待办（V-I） —— */
@media (max-width: 800px) {
  .yj-workbench-head p { font-size: 13px; line-height: 1.55; max-width: none; }
  .yj-workbench-grid { display: flex; flex-direction: column; gap: 14px; }
  .yj-workbench-grid > .yj-work-card:has(.yj-work-list),
  .yj-workbench-grid > .yj-work-card:first-of-type { order: -1; }
}

/* —— shell2v1：桌面导航图标基线（V-E） —— */
.desk-nav .nav-ico,
.admin-sidebar nav button .nav-ico {
  display: block;
  flex: none;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* shell2v3：项目卡同级操作统一尺寸，主次仅以色彩区分。 */
body.member-space .member-card-actions > :is(.primary-button, .outline-button, .yj-chip) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 44px;
  height: auto;
  padding: 11px 16px;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-decoration: none;
  touch-action: manipulation;
  transition: background-color .15s, color .15s;
}
body.member-space .member-card-actions > .primary-button { background: var(--hub-accent); color: #fff; }
body.member-space .member-card-actions > :is(.yj-chip, .outline-button) { background: #eaf3ff; color: #005dc5; }
html[data-theme=dark] body.member-space .member-card-actions > :is(.yj-chip, .outline-button) { background: #102c49; color: #8cc9ff; }
body.member-space .member-card-actions > a:active { opacity: .75; transform: none; }
.yj-nav-status {
  position: fixed;
  z-index: 10001;
  inset: auto 16px calc(82px + env(safe-area-inset-bottom, 0px));
  width: fit-content;
  max-width: calc(100% - 32px);
  margin-inline: auto;
  padding: 10px 16px;
  border: 1px solid var(--hub-line, #d1d1d6);
  border-radius: 12px;
  background: var(--hub-surface, #fff);
  color: var(--hub-ink, #1c1c1e);
  box-shadow: 0 4px 20px #00000014;
  font-size: 14px;
  line-height: 1.5;
  pointer-events: none;
}
.yj-nav-status[hidden] { display: none; }

/* shell2v4：项目台账触发项居中，并明确表示可展开。 */
body.workbench-page .desk-nav-more > summary {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  box-sizing: border-box; min-height: 44px; line-height: 1.2;
}
body.workbench-page .desk-nav-more > summary::after {
  content: ""; display: block; width: 6px; height: 6px; flex: 0 0 6px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
body.workbench-page .desk-nav-more[open] > summary::after { transform: rotate(225deg); }

/* shell2v4：后台业务说明保持可读，覆盖旧空间主题的微字级。 */
.admin-app .account-segments button { font-size: 14px; }
.admin-app .permission-flow-steps span,
.admin-app .account-contract > div > span,
.admin-app .account-contract p,
.admin-app .account-role-guide > div > span,
.admin-app .account-role-guide p,
.admin-app .user-identity small,
.admin-app .permission-current,
.admin-app .team-eligibility,
.admin-app .credit-summary,
.admin-app .permission-hint,
.admin-app .permission-hint a,
.admin-app #showreelForm small,
.admin-app .curation-toolbar > span { font-size: 12px; line-height: 1.6; }
.admin-app #showreelForm p { font-size: 13px; line-height: 1.6; }
.admin-app .member-toolbar .button,
.admin-app .permission-account .row-actions .button { font-size: 14px; min-height: 44px; }
.admin-app .user-identity strong { font-size: 14px; }
