/* app-v2 minimalist — 仅 body.ui-v2，不影响 index.html */
/* 不用 Google Fonts：国内访问 fonts.googleapis.com 极慢/超时，会拖垮首屏 */

body.ui-v2 {
  --v2-canvas: #f7f6f3;
  --v2-surface: #ffffff;
  --v2-soft: #f9f9f8;
  --v2-text: #2f3437;
  --v2-strong: #111111;
  --v2-muted: #787774;
  --v2-border: #eaeaea;
  --v2-ink: #111111;
  --v2-pale-blue-bg: #e1f3fe;
  --v2-pale-blue-fg: #1f6c9f;
  --v2-pale-green-bg: #edf3ec;
  --v2-pale-green-fg: #346538;
  --v2-pale-yellow-bg: #fbf3db;
  --v2-pale-yellow-fg: #956400;
  --v2-pale-red-bg: #fdebec;
  --v2-pale-red-fg: #9f2f2d;
  --v2-font: "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --v2-serif: "Songti SC", "STSong", "SimSun", serif;
  --v2-mono: "SF Mono", Menlo, Consolas, "Courier New", monospace;
  --v2-ease: cubic-bezier(0.16, 1, 0.3, 1);
  /* 预览横幅 + 顶栏，供业务页 height: calc(100dvh - …) 使用 */
  --v2-banner-h: 33px;
  --v2-topbar-h: 56px;
  --app-header-block: calc(var(--v2-banner-h) + var(--v2-topbar-h));
  --app-main-pad-y: 0px;
  --color-primary: #111111;
  --color-primary-light: #333333;
  --color-primary-dark: #000000;
  --color-primary-soft: #f3f2ef;
  --color-bg: var(--v2-canvas);
  --color-surface: var(--v2-surface);
  --color-border: var(--v2-border);
  --color-border-strong: #e0e0e0;
  --color-text: var(--v2-text);
  --color-text-muted: var(--v2-muted);
  --shadow-sm: none;
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.04);
  font-family: var(--v2-font);
  background: var(--v2-canvas);
  color: var(--v2-text);
  -webkit-font-smoothing: antialiased;
  /* 取消浏览器最右侧整页滚动条：高度锁在视口，只滚操作区内部 */
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
html:has(body.ui-v2) {
  height: 100%;
  overflow: hidden;
}

body.ui-v2 .v2-preview-banner {
  position: relative;
  top: auto;
  z-index: 1600;
  flex-shrink: 0;
  box-sizing: border-box;
  min-height: var(--v2-banner-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: var(--v2-ink);
  color: #f5f5f4;
  font-size: 12px;
}
body.ui-v2 .v2-preview-banner a {
  color: #d6d3d1;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}
body.ui-v2 .v2-preview-banner strong { color: #fff; }

/* —— 顶栏 —— */
body.ui-v2 .header.app-v2-topbar {
  display: flex !important;
  position: relative;
  top: auto;
  z-index: 50;
  flex: 0 0 var(--v2-topbar-h);
  height: var(--v2-topbar-h);
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  margin: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--v2-border);
  box-shadow: none;
}
body.ui-v2 .v2-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-right: 8px;
  white-space: nowrap;
}
body.ui-v2 .v2-brand-mark {
  font-family: var(--v2-serif);
  font-size: 20px;
  color: var(--v2-strong);
  letter-spacing: -0.03em;
}
body.ui-v2 .v2-brand-sub {
  font-size: 12px;
  color: var(--v2-muted);
  font-weight: 500;
}
body.ui-v2 .v2-mod-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}
body.ui-v2 .v2-mod-nav button {
  border: 0;
  background: transparent;
  color: var(--v2-muted);
  font: inherit;
  font-weight: 500;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
body.ui-v2 .v2-mod-nav button:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--v2-text);
}
body.ui-v2 .v2-mod-nav button.active {
  background: var(--v2-pale-blue-bg);
  color: var(--v2-pale-blue-fg);
}
body.ui-v2 .v2-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
body.ui-v2 .v2-month-wrap input[type="month"] {
  border: 1px solid var(--v2-border);
  border-radius: 6px;
  padding: 5px 8px;
  font: inherit;
  background: var(--v2-surface);
  color: var(--v2-text);
}
body.ui-v2 .header-user-btn {
  border: 1px solid var(--v2-border);
  background: var(--v2-soft);
  color: var(--v2-text);
  border-radius: 9999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  max-width: min(240px, 36vw);
}
body.ui-v2 .header-user-btn:hover { background: #f0efec; }
body.ui-v2 .db-status {
  font-size: 11px;
  color: var(--v2-muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* —— 布局 / 侧栏 —— */
body.ui-v2 .app-shell:not([hidden]) {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--v2-banner-h));
  height: calc(100dvh - var(--v2-banner-h));
  max-height: calc(100vh - var(--v2-banner-h));
  max-height: calc(100dvh - var(--v2-banner-h));
  overflow: hidden;
}
body.ui-v2 .app-shell .container.layout {
  display: grid;
  grid-template-columns: 228px 1fr;
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  max-width: none;
  padding: 0;
  flex: 1 1 auto;
  min-height: 0 !important;
  /* 覆盖业务页用 100vh 算高度的规则，避免顶栏+横幅叠出整页滚动条 */
  height: auto !important;
  max-height: none !important;
  overflow: hidden;
}
body.ui-v2 .app-shell.v2-no-sidebar .container.layout { grid-template-columns: 1fr; }
body.ui-v2 .app-shell.v2-no-sidebar #dormMenu { display: none !important; }

body.ui-v2 #dormMenu.sidebar {
  background: var(--v2-surface);
  border: 0;
  border-right: 1px solid var(--v2-border);
  border-radius: 0;
  box-shadow: none;
  padding: 16px 10px;
  gap: 2px;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
body.ui-v2 .v2-side-label {
  margin: 2px 10px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a8a29e;
}
body.ui-v2 #dormMenu .menu-module-toggle,
body.ui-v2 #dormMenu .menu-module-chevron,
body.ui-v2 #dormMenu .menu-btn-home {
  display: none !important;
}
body.ui-v2 #dormMenu .menu-module {
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
}
body.ui-v2 #dormMenu .menu-module-body {
  display: block !important;
  max-height: none !important;
  opacity: 1 !important;
  overflow: visible !important;
  visibility: visible !important;
  pointer-events: auto !important;
  padding: 0 !important;
  border-top: 0 !important;
  background: transparent !important;
}
body.ui-v2 #functionsMenuModule[hidden] {
  display: none !important;
}
body.ui-v2 #dormMenu .menu-group {
  border: 0;
  background: transparent;
  padding: 0;
  gap: 2px;
  display: grid;
}
body.ui-v2 #dormMenu .btn.menu-btn {
  width: 100%;
  text-align: left !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 6px;
  padding: 9px 12px !important;
  margin: 0 !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  font-family: inherit !important;
  color: var(--v2-text) !important;
  filter: none !important;
}
/* 压过旧版 style 里 .menu-btn-settings / special-equipment 的居中加粗卡片样式 */
body.ui-v2 #dormMenu .btn.menu-btn.menu-btn-settings,
body.ui-v2 #dormMenu .btn.menu-btn.menu-btn-special-equipment {
  text-align: left !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  background: transparent !important;
  color: var(--v2-text) !important;
  border: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 9px 12px !important;
  filter: none !important;
}
body.ui-v2 #dormMenu .btn.menu-btn:hover,
body.ui-v2 #dormMenu .btn.menu-btn.menu-btn-settings:hover,
body.ui-v2 #dormMenu .btn.menu-btn.menu-btn-special-equipment:hover {
  background: rgba(0, 0, 0, 0.03) !important;
  filter: none !important;
}
body.ui-v2 #dormMenu .btn.menu-btn.active,
body.ui-v2 #dormMenu .btn.menu-btn.menu-btn-settings.active,
body.ui-v2 #dormMenu .btn.menu-btn.menu-btn-special-equipment.active {
  background: var(--v2-soft) !important;
  color: var(--v2-strong) !important;
  font-weight: 600 !important;
  box-shadow: inset 2px 0 0 var(--v2-ink) !important;
  border: 0 !important;
}

/* 特种设备：功能在左侧，隐藏内容区顶栏 Tab */
body.ui-v2 #specialEquipmentTopChrome {
  display: none !important;
}

body.ui-v2 #specialEquipmentSideNav .se-side-soon {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--v2-muted, #94a3b8);
  letter-spacing: 0.02em;
}

body.ui-v2 #specialEquipmentSideNav .menu-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0;
}

body.ui-v2 .content {
  padding: 16px 18px 16px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: auto;
  background:
    radial-gradient(ellipse 50% 36% at 8% 0%, rgba(225, 243, 254, 0.32), transparent 60%),
    var(--v2-canvas);
}
/* 办公用品 / 特种设备：内容区本身不滚，只滚表格内部 */
body.ui-v2 main.container.layout:has(#officeSupplyPanel:not([hidden])) > .content,
body.ui-v2 main.container.layout:has(#officeSupplyApplyPanel:not([hidden])) > .content,
body.ui-v2 main.container.layout:has(#officeSupplyDistributionPanel:not([hidden])) > .content,
body.ui-v2 main.container.layout:has(#specialEquipmentPanel:not([hidden])) > .content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* —— 工具栏分层 —— */
body.ui-v2 .toolbar-box.v2-toolbar {
  position: relative;
  z-index: 60; /* 高于下方表格/面板，避免「更多」弹出层被盖住 */
  overflow: visible;
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: 10px;
  box-shadow: none;
  padding: 10px 12px;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
body.ui-v2 .v2-tb-mainline {
  display: contents;
}
body.ui-v2 .v2-tb-cluster {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
/* display:inline-flex 会盖掉 UA 的 [hidden]，必须显式隐藏 */
body.ui-v2 .v2-tb-cluster[hidden],
body.ui-v2 #mainSheetToolbar[hidden],
body.ui-v2 #dormFloorToolbar[hidden],
body.ui-v2 #meterFormToolbar[hidden],
body.ui-v2 #officeSupplyToolbarWrap[hidden],
body.ui-v2 #officeSupplyApplyToolbarWrap[hidden],
body.ui-v2 #officeSupplyDistributionToolbarWrap[hidden],
body.ui-v2 #officePrintToolbarWrap[hidden],
body.ui-v2 #specialEquipmentSheetTabsRow[hidden],
body.ui-v2 #specialEquipmentToolbarWrap[hidden],
body.ui-v2 #staffToolbarImportWrap[hidden],
body.ui-v2 #specialEquipmentTopChrome[hidden] {
  display: none !important;
}
body.ui-v2 .v2-tb-cluster + .v2-tb-cluster:not([hidden]) {
  padding-left: 10px;
  border-left: 1px solid var(--v2-border);
}

body.ui-v2 .btn {
  border-radius: 6px;
  font-weight: 600;
  border-color: var(--v2-border);
  background: #fff;
  color: var(--v2-text);
  box-shadow: none;
  transition: background 0.15s var(--v2-ease), border-color 0.15s var(--v2-ease);
}
body.ui-v2 .btn:hover {
  background: var(--v2-soft);
  border-color: #dedede;
}
body.ui-v2 .btn:active { transform: none; }
body.ui-v2 .btn.primary {
  background: var(--v2-ink) !important;
  background-image: none !important;
  border-color: var(--v2-ink) !important;
  color: #fff !important;
  box-shadow: none !important;
}
body.ui-v2 .btn.primary:hover {
  background: #333 !important;
  border-color: #333 !important;
}
body.ui-v2 .btn.v2-more-btn,
body.ui-v2 .btn.v2-ghostish {
  border-color: transparent;
  background: transparent;
  color: var(--v2-muted);
  font-weight: 500;
}
body.ui-v2 .btn.v2-more-btn:hover,
body.ui-v2 .btn.v2-ghostish:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--v2-text);
}

body.ui-v2 .v2-more-wrap {
  position: relative;
  display: inline-flex;
  z-index: 1;
}
body.ui-v2 .v2-more-wrap.open {
  z-index: 70;
}
body.ui-v2 .v2-more-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 80;
  min-width: 240px;
  max-width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--v2-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
body.ui-v2 .v2-more-panel[hidden] { display: none !important; }
body.ui-v2 .v2-more-panel > .btn,
body.ui-v2 .v2-more-panel > label.btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}
body.ui-v2 .v2-more-panel .batch-dates-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border: 1px dashed var(--v2-border);
  background: var(--v2-soft);
  border-radius: 8px;
  padding: 8px;
  margin: 0;
}
body.ui-v2 .v2-more-wrap.is-empty { display: none !important; }

body.ui-v2 .dorm-floor-group,
body.ui-v2 .meter-floor-group,
body.ui-v2 .meter-form-gender-group {
  border: 1px solid var(--v2-border);
  border-radius: 6px;
  overflow: hidden;
  display: inline-flex;
  margin: 0;
  padding: 0;
  gap: 0;
  background: #fff;
}
body.ui-v2 #dormToolbarActions,
body.ui-v2 #meterToolbarActions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}
body.ui-v2 .dorm-floor-group .btn,
body.ui-v2 .meter-floor-group .btn,
body.ui-v2 .meter-form-gender-group .btn {
  border: 0;
  border-right: 1px solid var(--v2-border);
  border-radius: 0;
  min-width: 48px;
}
body.ui-v2 .dorm-floor-group .btn:last-child,
body.ui-v2 .meter-floor-group .btn:last-child,
body.ui-v2 .meter-form-gender-group .btn:last-child {
  border-right: 0;
}
body.ui-v2 .dorm-floor-btn.active,
body.ui-v2 .meter-form-btn.active,
body.ui-v2 .meter-gender-btn.active {
  background: var(--v2-pale-blue-bg) !important;
  color: var(--v2-pale-blue-fg) !important;
}

body.ui-v2 .export-menu {
  border: 1px solid var(--v2-border);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  background: #fff;
}
body.ui-v2 .office-supply-dirty {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--v2-pale-yellow-fg);
  background: var(--v2-pale-yellow-bg);
  border-radius: 9999px;
  padding: 3px 8px;
}
body.ui-v2 .office-supply-readonly-tag {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--v2-muted);
  background: var(--v2-soft);
  border-radius: 9999px;
  padding: 3px 8px;
}

/* —— 表格 —— */
body.ui-v2 .table-wrap,
body.ui-v2 #mainTableWrap {
  border: 1px solid var(--v2-border);
  border-radius: 10px;
  background: var(--v2-surface);
  box-shadow: none;
  overflow: auto;
  scrollbar-gutter: stable;
}
body.ui-v2 table th {
  background: var(--v2-soft);
  color: var(--v2-muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.03em;
}
body.ui-v2 table td,
body.ui-v2 table th {
  border-color: var(--v2-border);
}
body.ui-v2 #mainTableWrap input:focus,
body.ui-v2 #mainTableWrap select:focus {
  outline: none;
  border-color: #d4d4d4;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

/* —— 首页 / 看板 —— */
body.ui-v2 .home-dashboard,
body.ui-v2 .home-portal-dash {
  background: var(--v2-surface) !important;
  border: 1px solid var(--v2-border) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  overflow: hidden;
}
body.ui-v2 .home-dash-bg { display: none !important; }
body.ui-v2 .home-dash-title {
  font-family: var(--v2-serif) !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  color: var(--v2-strong) !important;
  font-weight: 400 !important;
  letter-spacing: -0.02em !important;
  font-size: 26px !important;
}
body.ui-v2 .home-dash-eyebrow {
  background: transparent !important;
  color: var(--v2-muted) !important;
  border: 0 !important;
  letter-spacing: 0.08em !important;
  padding: 0 !important;
}
body.ui-v2 .home-dash-live-pill {
  background: var(--v2-pale-green-bg) !important;
  color: var(--v2-pale-green-fg) !important;
  border: 0 !important;
  box-shadow: none !important;
  animation: none !important;
}
body.ui-v2 .home-dash-live-pill::before { display: none !important; }
body.ui-v2 .home-dash-header {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 8px 4px 12px !important;
}
body.ui-v2 .home-dash-header::before { display: none !important; }
body.ui-v2 .home-dash-clock {
  background: var(--v2-soft) !important;
  border: 1px solid var(--v2-border) !important;
  font-family: var(--v2-mono);
}
body.ui-v2 .home-dash-card,
body.ui-v2 .home-portal-card {
  background: var(--v2-surface) !important;
  border: 1px solid var(--v2-border) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}
body.ui-v2 .home-dash-card:hover,
body.ui-v2 .home-portal-card:hover {
  transform: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  border-color: #e0e0e0 !important;
}
body.ui-v2 .home-dash-card::before { display: none !important; }
body.ui-v2 .home-dash-card-value {
  font-family: var(--v2-mono) !important;
  font-weight: 500 !important;
}
body.ui-v2 .home-dash-card-tag,
body.ui-v2 .home-portal-card-action {
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
body.ui-v2 .home-portal-cards {
  gap: 12px !important;
}
body.ui-v2 .home-portal-card-icon {
  display: none !important; /* no emoji-forward look */
}
body.ui-v2 .home-portal-card-title {
  font-size: 16px !important;
  font-weight: 650 !important;
  color: var(--v2-strong) !important;
}
body.ui-v2 .home-portal-card-desc {
  color: var(--v2-muted) !important;
}
body.ui-v2 .home-portal-card-action {
  color: var(--v2-strong) !important;
  background: var(--v2-soft);
  display: inline-block;
  padding: 4px 10px;
  margin-top: 8px;
}
body.ui-v2 .home-dash-bar-fill {
  border-radius: 4px 4px 0 0 !important;
  opacity: 0.85;
}

/* 设置 / 导出布局面板 */
body.ui-v2 .settings-panel,
body.ui-v2 .export-layout-section {
  border-color: var(--v2-border);
  border-radius: 10px;
}
body.ui-v2 .settings-title {
  font-family: var(--v2-serif);
  font-weight: 400;
  letter-spacing: -0.02em;
}
body.ui-v2 .settings-role-badge {
  background: var(--v2-pale-blue-bg);
  color: var(--v2-pale-blue-fg);
}

/* 特种设备 */
body.ui-v2 .special-equipment-sheet-tabs {
  gap: 4px;
}
body.ui-v2 .special-equipment-sheet-btn.active,
body.ui-v2 .special-equipment-host .btn.active {
  background: var(--v2-pale-blue-bg) !important;
  color: var(--v2-pale-blue-fg) !important;
  border-color: transparent !important;
}

/* 登录 */
body.ui-v2.welcome-active,
body.ui-v2.auth-checking {
  background: var(--v2-canvas) !important;
}
body.ui-v2 .welcome-screen { background: var(--v2-canvas) !important; }
body.ui-v2 .welcome-bg,
body.ui-v2 .welcome-orb { display: none !important; }
body.ui-v2 .welcome-layout {
  box-shadow: none;
  border: 1px solid var(--v2-border);
  border-radius: 12px;
  background: var(--v2-surface);
  max-width: 420px;
  min-height: 0;
}
body.ui-v2 .welcome-hero { display: none !important; }
body.ui-v2 .welcome-card {
  padding: 32px 28px;
  background: transparent;
}
body.ui-v2 .welcome-title {
  font-family: var(--v2-serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--v2-strong);
}
body.ui-v2 .welcome-subtitle { color: var(--v2-muted); }
body.ui-v2 .welcome-login-btn.btn,
body.ui-v2 .welcome-login-btn {
  background: var(--v2-ink) !important;
  background-image: none !important;
  border-color: var(--v2-ink) !important;
  color: #fff !important;
  border-radius: 6px;
}
body.ui-v2 .welcome-input-wrap input {
  border-radius: 6px;
  border-color: var(--v2-border);
}

body.ui-v2 .sidebar-hint-panel {
  border: 1px solid var(--v2-border);
  background: var(--v2-soft);
  border-radius: 8px;
  margin-top: 12px;
}
body.ui-v2 .toast-msg {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* 首页时工具栏可隐藏（无业务操作） */
body.ui-v2[data-v2-module="home"] #mainToolbarBox {
  display: none !important;
}

@media (max-width: 900px) {
  body.ui-v2 .app-shell .container.layout { grid-template-columns: 1fr; }
  body.ui-v2 #dormMenu.sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--v2-border);
  }
  body.ui-v2 .v2-brand-sub { display: none; }
  body.ui-v2 .db-status { display: none; }
}

/* ========== 细节完善：门户 / 看板 / 设置 / 导出 / 特种设备 / 弹窗 ========== */

/* 系统首页：只留模块入口，隐藏嵌入的水电/办公大屏 */
body.ui-v2 .content.home-portal-combined #homeDashboardPanel.home-dash-embedded,
body.ui-v2 .content.home-portal-combined #officeDashboardPanel.home-dash-embedded {
  display: none !important;
}
body.ui-v2 .home-portal-dash {
  padding: 28px 28px 32px !important;
  max-width: 980px;
  margin: 0 auto;
}
body.ui-v2 .home-portal-cards.v2-portal-grid,
body.ui-v2 .v2-portal-grid {
  display: grid !important;
  grid-template-columns: 1.15fr 1fr 1fr !important;
  gap: 12px !important;
}
@media (max-width: 900px) {
  body.ui-v2 .home-portal-cards.v2-portal-grid,
  body.ui-v2 .v2-portal-grid {
    grid-template-columns: 1fr !important;
  }
}
body.ui-v2 .home-portal-card {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 22px 20px !important;
  min-height: 168px;
  cursor: pointer;
}
body.ui-v2 .home-portal-card-kicker {
  display: inline-block;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 9999px;
  margin-bottom: 12px;
  background: var(--v2-pale-blue-bg);
  color: var(--v2-pale-blue-fg);
}
body.ui-v2 .home-portal-card-office .home-portal-card-kicker {
  background: var(--v2-pale-green-bg);
  color: var(--v2-pale-green-fg);
}
body.ui-v2 .home-portal-card-equipment .home-portal-card-kicker {
  background: var(--v2-pale-yellow-bg);
  color: var(--v2-pale-yellow-fg);
}
body.ui-v2 .home-portal-card-title { margin-bottom: 6px; }
body.ui-v2 .home-portal-card-desc {
  flex: 1;
  margin-bottom: 14px;
  line-height: 1.55;
}
body.ui-v2 .home-portal-month {
  margin-top: 8px;
  font-family: var(--v2-mono);
  font-size: 12px;
  color: var(--v2-muted);
}

/* 模块内看板面板 */
body.ui-v2 .home-dash-panel {
  background: var(--v2-surface) !important;
  border: 1px solid var(--v2-border) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}
body.ui-v2 .home-dash-panel-title {
  font-size: 13px !important;
  font-weight: 650 !important;
  color: var(--v2-strong) !important;
  letter-spacing: -0.01em;
}
body.ui-v2 .home-dash-panel-icon { display: none !important; }
body.ui-v2 .home-dash-card-icon { display: none !important; }
body.ui-v2 .home-dash-card-tag {
  background: var(--v2-soft) !important;
  color: var(--v2-muted) !important;
  border: 0 !important;
}
body.ui-v2 .home-dash-card-male .home-dash-card-tag {
  background: var(--v2-pale-yellow-bg) !important;
  color: var(--v2-pale-yellow-fg) !important;
}
body.ui-v2 .home-dash-card-female .home-dash-card-tag {
  background: var(--v2-pale-green-bg) !important;
  color: var(--v2-pale-green-fg) !important;
}
body.ui-v2 .home-dash-card-total .home-dash-card-tag {
  background: var(--v2-pale-blue-bg) !important;
  color: var(--v2-pale-blue-fg) !important;
}
body.ui-v2 .home-dash-card-empty .home-dash-card-tag {
  background: var(--v2-pale-red-bg) !important;
  color: var(--v2-pale-red-fg) !important;
}
body.ui-v2 .home-dash-quick-btn {
  border: 1px solid var(--v2-border) !important;
  background: #fff !important;
  border-radius: 6px !important;
  justify-content: flex-start;
}
body.ui-v2 .home-dash-cal-day.today {
  background: var(--v2-ink) !important;
  color: #fff !important;
  border-radius: 6px;
}
body.ui-v2 .home-dash-notice-list {
  color: var(--v2-muted);
  font-size: 12.5px;
  line-height: 1.6;
}

/* 设置页 */
body.ui-v2 .settings-panel {
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: 12px;
  padding: 20px 22px !important;
  max-width: 760px;
}
body.ui-v2 .settings-title {
  font-family: var(--v2-serif);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--v2-strong);
}
body.ui-v2 .settings-subtitle {
  font-size: 14px;
  font-weight: 650;
  color: var(--v2-strong);
  margin-top: 18px;
}
body.ui-v2 .settings-hint,
body.ui-v2 .settings-meta,
body.ui-v2 .settings-perms-hint,
body.ui-v2 .settings-restore-hint {
  color: var(--v2-muted) !important;
}
body.ui-v2 .settings-add-form,
body.ui-v2 .settings-edit-user-wrap,
body.ui-v2 .settings-restore-wrap,
body.ui-v2 .settings-perms-block {
  border: 1px solid var(--v2-border);
  border-radius: 10px;
  background: var(--v2-soft);
  padding: 14px;
}
body.ui-v2 .settings-users-table {
  border: 1px solid var(--v2-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
body.ui-v2 .settings-users-table th {
  background: var(--v2-soft);
  color: var(--v2-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
body.ui-v2 .settings-role-badge.admin {
  background: var(--v2-pale-blue-bg) !important;
  color: var(--v2-pale-blue-fg) !important;
}
body.ui-v2 .settings-role-badge.user {
  background: var(--v2-soft) !important;
  color: var(--v2-muted) !important;
}
body.ui-v2 .settings-import-actions input[type="file"],
body.ui-v2 .staff-toolbar-import input[type="file"] {
  border: 1px solid var(--v2-border);
  border-radius: 6px;
  padding: 4px;
  background: #fff;
}

/* 导出布局 */
body.ui-v2 .export-layout-section {
  background: #fff;
  border: 1px solid var(--v2-border) !important;
  border-radius: 10px !important;
}
body.ui-v2 .export-layout-tab {
  border-radius: 6px !important;
  border-color: var(--v2-border) !important;
}
body.ui-v2 .export-layout-tab[aria-selected="true"],
body.ui-v2 .export-layout-tab.active {
  background: var(--v2-pale-blue-bg) !important;
  color: var(--v2-pale-blue-fg) !important;
  border-color: transparent !important;
}

/* 导出预览层 */
body.ui-v2 .export-viewer-shell {
  background: var(--v2-canvas);
}
body.ui-v2 .export-viewer-toolbar,
body.ui-v2 .export-viewer-footer {
  background: var(--v2-surface) !important;
  border-color: var(--v2-border) !important;
}
body.ui-v2 .export-viewer-tool-btn,
body.ui-v2 .export-viewer-footer-btn {
  border-radius: 6px !important;
  border: 1px solid var(--v2-border) !important;
  background: #fff !important;
  color: var(--v2-text) !important;
}
body.ui-v2 .export-viewer-tool-btn-primary,
body.ui-v2 .export-viewer-footer-btn-primary {
  background: var(--v2-ink) !important;
  border-color: var(--v2-ink) !important;
  color: #fff !important;
}
body.ui-v2 .export-viewer-filename {
  font-family: var(--v2-mono);
  font-size: 12px;
}

/* 人员库 */
body.ui-v2 .staff-panel {
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: 12px;
  padding: 16px;
}
body.ui-v2 .staff-query-label { color: var(--v2-muted); font-weight: 600; }
body.ui-v2 .staff-preview-wrap {
  border: 1px solid var(--v2-border);
  border-radius: 10px;
}
body.ui-v2 .staff-preview-table th {
  background: var(--v2-soft);
  color: var(--v2-muted);
}
body.ui-v2 .staff-import-warning {
  color: var(--v2-pale-yellow-fg) !important;
  background: var(--v2-pale-yellow-bg);
  border-radius: 6px;
  padding: 6px 10px;
  border: 0 !important;
}

/* 办公用品面板 */
body.ui-v2 .office-supply-panel,
body.ui-v2 [id^="officeSupply"] .panel,
body.ui-v2 #officeSupplyPanel,
body.ui-v2 #officeSupplyApplyPanel,
body.ui-v2 #officeSupplyDistributionPanel,
body.ui-v2 #officePrintSummaryPanel {
  border-color: var(--v2-border);
}
/* 办公用品宽表：限制在内容区宽度内横向滚动，避免小屏右侧被裁切 */
body.ui-v2 #officeSupplyPanel,
body.ui-v2 #officeSupplyApplyPanel,
body.ui-v2 #officeSupplyDistributionPanel,
body.ui-v2 .office-supply-panel,
body.ui-v2 .office-dist-panel,
body.ui-v2 .office-supply-table-wrap,
body.ui-v2 .office-dist-table-wrap,
body.ui-v2 .office-apply-excel-wrap {
  min-width: 0;
  max-width: 100%;
}
body.ui-v2 .office-supply-table-wrap,
body.ui-v2 .office-dist-table-wrap,
body.ui-v2 .office-apply-excel-wrap {
  overflow: auto;
}
/* transform 动画会破坏 overflow 裁剪链，宽表页禁用位移 */
body.ui-v2 .content > #officeSupplyPanel:not([hidden]),
body.ui-v2 .content > #officeSupplyApplyPanel:not([hidden]),
body.ui-v2 .content > #officeSupplyDistributionPanel:not([hidden]),
body.ui-v2 .content > #specialEquipmentPanel:not([hidden]) {
  animation: none;
}
body.ui-v2 .office-apply-dept-picker,
body.ui-v2 .office-apply-month-range,
body.ui-v2 .office-print-period-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--v2-muted);
  font-size: 12.5px;
  font-weight: 500;
}
body.ui-v2 .office-apply-dept-select,
body.ui-v2 .office-apply-month-input,
body.ui-v2 input[type="month"],
body.ui-v2 input[type="date"],
body.ui-v2 input[type="text"],
body.ui-v2 input[type="password"],
body.ui-v2 select {
  border-color: var(--v2-border) !important;
  border-radius: 6px !important;
  background: #fff;
}
/* 汇总表名称列右键填色：覆盖上方 input 白底，否则黄色几乎看不见 */
body.ui-v2 .office-supply-table td.os-name-fill-yellow,
body.ui-v2 .office-supply-table td.os-name-fill-yellow input,
body.ui-v2 .office-supply-table td.os-name-fill-yellow input:focus {
  background: #ffeb3b !important;
}
body.ui-v2 .office-supply-table td.os-name-fill-blue,
body.ui-v2 .office-supply-table td.os-name-fill-blue input,
body.ui-v2 .office-supply-table td.os-name-fill-blue input:focus {
  background: #4472c4 !important;
  color: #fff !important;
}
body.ui-v2 input:focus,
body.ui-v2 select:focus {
  outline: none;
  border-color: #d4d4d4 !important;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

/* 特种设备 */
body.ui-v2 .special-equipment-host,
body.ui-v2 #specialEquipmentPanel {
  background: var(--v2-surface);
  border: 1px solid var(--v2-border);
  border-radius: 12px;
  padding: 14px 16px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.ui-v2 .special-equipment-sheet-btn,
body.ui-v2 .se-nav-btn,
body.ui-v2 .se-tab {
  border-radius: 6px !important;
  border: 1px solid var(--v2-border) !important;
  background: #fff !important;
}
body.ui-v2 .special-equipment-sheet-btn.active,
body.ui-v2 .se-nav-btn.active,
body.ui-v2 .se-tab.active {
  background: var(--v2-pale-blue-bg) !important;
  color: var(--v2-pale-blue-fg) !important;
  border-color: transparent !important;
}
body.ui-v2 .se-card,
body.ui-v2 .se-law-block {
  border: 1px solid var(--v2-border) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  background: #fff !important;
}

/* 弹窗 */
body.ui-v2 .login-modal-card,
body.ui-v2 .office-apply-links-card {
  border: 1px solid var(--v2-border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  background: var(--v2-surface);
}
body.ui-v2 .login-modal-title {
  font-family: var(--v2-serif);
  font-weight: 400;
  letter-spacing: -0.02em;
}
body.ui-v2 .login-modal-backdrop {
  background: rgba(47, 52, 55, 0.35);
}

/* 登录页 logo */
body.ui-v2 .welcome-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--v2-ink);
  color: #fff !important;
  display: grid;
  place-items: center;
}
body.ui-v2 .welcome-logo svg { color: #fff; }
body.ui-v2 .welcome-field label {
  color: var(--v2-muted);
  font-weight: 600;
  font-size: 12px;
}
body.ui-v2 .welcome-login-error:not([hidden]) {
  background: var(--v2-pale-red-bg);
  color: var(--v2-pale-red-fg);
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  max-height: 120px;
  overflow: auto;
}

/* 滚动条克制 */
body.ui-v2 *::-webkit-scrollbar { width: 10px; height: 10px; }
body.ui-v2 *::-webkit-scrollbar-thumb {
  background: #d6d3d1;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
body.ui-v2 *::-webkit-scrollbar-track { background: transparent; }

/* 内容区动画 */
body.ui-v2 .content > section:not([hidden]) {
  animation: v2rise 0.45s var(--v2-ease) both;
}
@keyframes v2rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 设置模块侧栏时也隐藏工具栏 */
body.ui-v2[data-v2-module="settings"] #mainToolbarBox {
  display: none !important;
}
