/* 上上签 · 手机版面（屏幕窄于 820px 时生效）：
   「人生」原来是电脑版左右两栏，手机上改成：上面一排可左右滑动的栏目，下面内容单栏从上往下排。 */
html.ssq-engine-view body { background: var(--bg, #ecf0f9); }
html.ssq-engine-view .sidebar-footer { display: none; }

@media (max-width: 820px) {
  html.ssq-engine-view .app-shell,
  html.ssq-engine-view .app-shell.sidebar-collapsed { display: block !important; min-height: 0; }
  html.ssq-engine-view .app-shell > .sidebar,
  html.ssq-engine-view .app-shell.sidebar-collapsed > .sidebar {
    display: block !important; position: sticky; top: var(--ssq-bar-h, 92px); z-index: 80;
    height: auto; padding: 6px 8px; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    box-shadow: 0 2px 10px rgba(15, 41, 110, 0.25);
  }
  html.ssq-engine-view .sidebar::-webkit-scrollbar { display: none; }
  html.ssq-engine-view .sidebar .brand { display: none; }
  html.ssq-engine-view .nav-list { display: flex !important; gap: 4px; width: max-content; }
  html.ssq-engine-view .nav-item { width: auto !important; min-height: 38px; padding: 0 11px 0 7px; gap: 6px; border-radius: 19px; white-space: nowrap; font-size: 14px; }
  html.ssq-engine-view .nav-item > span:not(.nav-icon) { display: inline !important; }
  html.ssq-engine-view .nav-item.active { background: #fff; color: #1e3a8a; font-weight: 750; }
  html.ssq-engine-view .nav-icon { width: 24px; height: 24px; }
  html.ssq-engine-view #sidebarToggle { display: none !important; }

  html.ssq-engine-view .workspace { display: block !important; width: 100% !important; padding: 10px 10px 40px !important; min-width: 0; }
  html.ssq-engine-view .topbar { display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
  html.ssq-engine-view .topbar-primary { flex-wrap: wrap; }
  html.ssq-engine-view #viewTitle { writing-mode: horizontal-tb !important; white-space: nowrap; font-size: 19px; }
  html.ssq-engine-view .view.active { display: block !important; width: 100% !important; min-width: 0; }

  /* 所有「左内容 + 右操作栏」的页面改成单栏：操作栏放在最上面 */
  html.ssq-engine-view :is(.ops-layout, .employee-ledger-shell, .management-summary-shell, .monthly-report-shell, .employee-flow-shell, .wallet-reconciliation-shell) {
    display: flex !important; flex-direction: column; gap: 12px; width: 100% !important; max-width: 100% !important; grid-template-columns: 1fr !important;
  }
  html.ssq-engine-view :is(.ops-side, .employee-ledger-side) {
    order: -1; position: static !important; width: 100% !important; max-width: 100% !important; box-shadow: none !important;
  }
  html.ssq-engine-view :is(.ops-layout, .employee-ledger-shell, .management-summary-shell, .monthly-report-shell, .employee-flow-shell, .wallet-reconciliation-shell) > * {
    width: 100% !important; max-width: 100% !important; min-width: 0 !important;
  }
  html.ssq-engine-view .operation-panel,
  html.ssq-engine-view .panel { width: 100% !important; max-width: 100% !important; min-width: 0; }

  /* 表格太宽时左右滑动，不把文字挤成竖排 */
  html.ssq-engine-view .view.active table { min-width: max-content; }
  html.ssq-engine-view .view.active :is(.table-wrap, .table-scroll, .ledger-table-wrap, .report-table-wrap) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  html.ssq-engine-view .view.active :is(h2, h3, label, button, .field-label) { writing-mode: horizontal-tb !important; word-break: keep-all; }
  html.ssq-engine-view .view.active :is(input, select, textarea) { font-size: 16px; max-width: 100%; }
}

/* A3：「人生」自己的侧栏不再用，入口统一在上上签顶部 */
html.ssq-engine-view .app-shell,
html.ssq-engine-view .app-shell.sidebar-collapsed { grid-template-columns: minmax(0, 1fr) !important; }
html.ssq-engine-view .app-shell > .sidebar { display: none !important; }
html.ssq-engine-view #sidebarToggle { display: none !important; }
html.ssq-engine-view .app-shell.sidebar-collapsed > .sidebar { display: none !important; }
