:root {
  --hcr-bottom-frame-height: 35px;
}

.desktop-titlebar {
  display: none;
}

.desktop-resize-handle {
  display: none;
}

body.desktop-mode {
  overflow: hidden;
}

body.desktop-mode::before {
  position: fixed;
  z-index: 2147483646;
  inset: 0;
  box-sizing: border-box;
  border: 1px solid #8297b0;
  content: "";
  pointer-events: none;
}

body.desktop-mode #app {
  height: calc(100vh - 35px);
  min-height: 0;
  margin-top: 35px;
  overflow: auto;
}

body.desktop-mode:not(.auth-mode) #app {
  overflow: hidden;
}

.desktop-bottom-frame {
  position: fixed;
  z-index: 9999;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 0 34px;
  height: var(--hcr-bottom-frame-height) !important;
  min-height: var(--hcr-bottom-frame-height) !important;
  max-height: var(--hcr-bottom-frame-height) !important;
  box-sizing: border-box;
  border-top: 1px solid #d7e0eb;
  background: #fff;
  box-shadow: 0 -1px 4px rgba(39, 70, 107, .05);
  pointer-events: none;
}

.desktop-status-note,
.desktop-status-meta,
.desktop-status-item {
  display: flex;
  min-width: 0;
  align-items: center;
  color: #72869f;
  font: 400 12px/1.2 "Microsoft YaHei", "Segoe UI", sans-serif;
  white-space: nowrap;
}

.desktop-status-note {
  gap: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-status-note-icon {
  display: inline-grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  color: #7189a4;
  font-family: "Segoe Fluent Icons", "Segoe MDL2 Assets";
  font-size: 13px;
  line-height: 1;
}

.desktop-status-note-icon::before {
  content: attr(data-glyph);
}

.desktop-status-meta {
  justify-content: flex-end;
  gap: 18px;
  pointer-events: none;
}

.desktop-status-item {
  gap: 7px;
}

.desktop-status-refresh-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid #bfd1e8;
  border-radius: 5px;
  color: #2767bd;
  background: #f4f8fd;
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
  cursor: pointer;
  pointer-events: auto;
}

.desktop-status-refresh-hint::before {
  content: "↻";
  font-size: 13px;
  line-height: 1;
}

.desktop-status-refresh-hint[hidden] {
  display: none;
}

.desktop-status-refresh-hint:hover:not(:disabled),
.desktop-status-refresh-hint:focus-visible {
  border-color: #8db3e4;
  background: #eaf3ff;
}

.desktop-status-refresh-hint:disabled {
  cursor: default;
}

.desktop-interface-refresh {
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid #cbd7e5;
  border-radius: 5px;
  background: #fff;
  color: #526b89;
  font: 400 11px/1.2 "Microsoft YaHei", "Segoe UI", sans-serif;
  cursor: pointer;
  pointer-events: auto;
}

.desktop-interface-refresh:hover,
.desktop-interface-refresh:focus-visible {
  border-color: #8db3e4;
  background: #f4f8fd;
  color: #2767bd;
}

.desktop-status-label,
.desktop-status-value {
  color: #71849c;
  font-weight: 400;
}

.desktop-status-divider {
  width: 1px;
  height: 18px;
  background: #cbd6e2;
}

.desktop-status-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-status-item[data-status-tone="ok"] .desktop-status-value {
  color: #71849c;
}

.desktop-status-item[data-status-tone="warn"] .desktop-status-value {
  color: #8a806f;
}

.desktop-status-item[data-status-tone="loading"] .desktop-status-value {
  color: #3478f6;
}

.desktop-status-item[data-status-tone="error"] .desktop-status-value {
  color: #c43d3d;
}

.desktop-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #aebdcb;
}

.desktop-status-item[data-status-tone="ok"] .desktop-status-dot {
  background: #1dac72;
}

.desktop-status-item[data-status-tone="warn"] .desktop-status-dot {
  background: #d7a154;
}

.desktop-status-item[data-status-tone="loading"] .desktop-status-dot {
  background: #3478f6;
}

.desktop-status-item[data-status-tone="error"] .desktop-status-dot {
  background: #dc3c3c;
}

.desktop-status-item[data-status-tone="pending"] .desktop-status-dot {
  background: #aebdcb;
}

body.auth-mode .desktop-bottom-frame {
  display: none;
}

body.desktop-mode:not(.auth-mode) #app {
  box-sizing: border-box;
  padding-bottom: var(--hcr-bottom-frame-height);
}

body.desktop-mode:not(.auth-mode) #app > :is(.project-workbench, .workbench),
body.desktop-mode:not(.auth-mode) #app > :is(.project-workbench, .workbench) > .project-side {
  min-height: 0 !important;
}

body.desktop-mode .desktop-resize-handle {
  position: fixed;
  z-index: 2147483647;
  display: block;
  background: transparent;
  touch-action: none;
}

body.desktop-mode .desktop-resize-handle.resize-n { top: 0; right: 10px; left: 10px; height: 6px; cursor: n-resize; }
body.desktop-mode .desktop-resize-handle.resize-ne { top: 0; right: 0; width: 10px; height: 10px; cursor: ne-resize; }
body.desktop-mode .desktop-resize-handle.resize-e { top: 10px; right: 0; bottom: 10px; width: 6px; cursor: e-resize; }
body.desktop-mode .desktop-resize-handle.resize-se { right: 0; bottom: 0; width: 10px; height: 10px; cursor: se-resize; }
body.desktop-mode .desktop-resize-handle.resize-s { right: 10px; bottom: 0; left: 10px; height: 6px; cursor: s-resize; }
body.desktop-mode .desktop-resize-handle.resize-sw { bottom: 0; left: 0; width: 10px; height: 10px; cursor: sw-resize; }
body.desktop-mode .desktop-resize-handle.resize-w { top: 10px; bottom: 10px; left: 0; width: 6px; cursor: w-resize; }
body.desktop-mode .desktop-resize-handle.resize-nw { top: 0; left: 0; width: 10px; height: 10px; cursor: nw-resize; }

body.desktop-mode .desktop-titlebar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10000;
  display: flex;
  height: 35px;
  align-items: center;
  color: #fff;
  background: #073da9;
  border-bottom: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 1px 5px rgba(4, 30, 91, .18);
  user-select: none;
}

.desktop-titlebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.desktop-titlebar-copy {
  display: inline-flex;
  align-items: flex-end;
  gap: 12px;
  white-space: nowrap;
}

.desktop-titlebar-label {
  line-height: 1;
}

.desktop-titlebar-version {
  display: inline-block;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, .76);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: .2px;
  white-space: nowrap;
}

body.desktop-mode:not(.auth-mode) .desktop-titlebar-version {
  color: #738197;
}

.desktop-titlebar-drag {
  align-self: stretch;
  flex: 1;
}

.desktop-titlebar-actions {
  display: flex;
  align-self: stretch;
  align-items: stretch;
  flex: 0 0 auto;
}

.desktop-titlebar-actions button {
  width: 46px;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent;
  font: 16px/1 "Microsoft YaHei", sans-serif;
  cursor: default;
}

.desktop-titlebar-actions button:hover {
  background: rgba(255, 255, 255, .14);
}

.desktop-titlebar-actions button:focus {
  outline: none;
}

.desktop-titlebar-actions .desktop-titlebar-close:hover {
  background: #d83b3b;
}

body.desktop-mode .workbench,
body.desktop-mode .project-workbench,
body.desktop-mode .project-side,
body.desktop-mode .status-page,
body.desktop-mode .auth-shell {
  min-height: calc(100vh - 35px);
}

body.auth-mode .desktop-titlebar-actions button[data-window-action="maximize"] {
  display: none;
}

/* The approved compact login sample is the whole auth window, not a card on a large canvas. */
body.desktop-mode #app {
  height: calc(100vh - 35px);
  margin-top: 35px;
}

body.desktop-mode .desktop-titlebar {
  height: 35px;
  background: linear-gradient(135deg, #246fc9 0%, #155bb7 100%);
  box-shadow: 0 1px 5px rgba(4, 30, 91, .18);
}

.desktop-titlebar-brand {
  padding-left: 14px;
  font-size: 12px;
  letter-spacing: .1px;
}

.desktop-titlebar-actions button {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 100%;
  flex: 0 0 auto;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-size: 0;
  line-height: 0;
  appearance: none;
}

.desktop-titlebar-actions svg {
  display: block;
  width: 13px;
  height: 13px;
  margin: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: square;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.desktop-titlebar-actions .desktop-titlebar-icon-restore { display: none; }
.desktop-titlebar[data-window-maximized="true"] .desktop-titlebar-icon-maximize { display: none; }
.desktop-titlebar[data-window-maximized="true"] .desktop-titlebar-icon-restore { display: block; }

body.desktop-mode .workbench,
body.desktop-mode .project-workbench,
body.desktop-mode .project-side,
body.desktop-mode .status-page,
body.desktop-mode .auth-shell {
  min-height: calc(100vh - 35px);
}

body.auth-mode.desktop-mode #app,
body.auth-mode.desktop-mode .auth-shell {
  background: #f8fafc;
  overflow: auto;
}

body.auth-mode.desktop-mode .auth-brand {
  display: none;
}

.auth-card .notice.error {
  min-height: 0;
  padding: 7px 10px;
  border: 1px solid #ecd3d1;
  background: #fff8f7;
  color: #a52b27;
  font-size: 12px;
  line-height: 1.4;
}

.auth-card .notice:focus {
  outline: 2px solid rgba(216, 91, 87, .3);
  outline-offset: 2px;
}

.data-disconnected-workbench .project-main {
  min-width: 0;
}

.data-disconnected-workbench .project-top {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 0 24px;
  color: #304766;
  font-size: 14px;
}

.data-disconnected-workbench .project-workspace {
  display: grid;
  min-height: calc(100% - 54px);
  place-items: center;
  padding: 32px;
}

.data-disconnected {
  width: min(560px, 100%);
  padding: 34px 38px;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(34, 62, 96, .05);
  text-align: center;
}

.data-disconnected h2 {
  margin: 0;
  color: #243d60;
  font-size: 21px;
  font-weight: 400;
}

.data-disconnected-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.data-disconnected-actions .btn {
  font-weight: 400;
}

.cloud-initialization-workspace {
  overflow: auto;
}

.cloud-initialization-entry {
  width: min(680px, calc(100% - 32px));
  padding: 28px;
  border: 1px solid #d8e2ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(38, 67, 105, .08);
}

.cloud-initialization-heading {
  text-align: center;
}

.cloud-initialization-heading h2 {
  margin: 10px 0 8px;
  color: #243d60;
  font-size: 20px;
  font-weight: 400;
}

.cloud-initialization-heading p {
  margin: 0;
  color: #71839c;
  font-size: 14px;
}

.cloud-initialization-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.cloud-initialization-options-two {
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-inline: auto;
}

.cloud-initialization-option {
  display: flex;
  min-height: 116px;
  padding: 18px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 9px;
  border: 1px solid #cfdbea;
  border-radius: 9px;
  background: #fff;
  color: #22508f;
  text-align: left;
  cursor: pointer;
}

.cloud-initialization-option:hover,
.cloud-initialization-option:focus-visible {
  border-color: #70a1ed;
  background: #f4f8ff;
  box-shadow: 0 0 0 3px rgba(11, 99, 236, .09);
  outline: none;
}

.cloud-initialization-option strong {
  font-size: 15px;
  font-weight: 400;
}

.cloud-initialization-option span {
  color: #71839c;
  font-size: 12px;
  line-height: 1.65;
}

.cloud-initialization-option-primary {
  border-color: #0b63ec;
  background: #0b63ec;
  color: #fff;
}

.cloud-initialization-option-primary span {
  color: rgba(255, 255, 255, .82);
}

.cloud-initialization-option-primary:hover,
.cloud-initialization-option-primary:focus-visible {
  border-color: #0758d7;
  background: #0758d7;
  box-shadow: 0 0 0 3px rgba(11, 99, 236, .18);
}

@media (max-width: 580px) {
  .cloud-initialization-options-two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .desktop-bottom-frame {
    gap: 14px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .desktop-status-note,
  .desktop-status-meta,
  .desktop-status-item {
    font-size: 11px;
  }

  .desktop-status-meta {
    gap: 11px;
  }

  .desktop-status-item {
    gap: 6px;
  }

  .desktop-status-note {
    gap: 8px;
  }

  .desktop-status-divider {
    height: 16px;
  }
}

/* 首次公司数据位置选择：专用范围，保留三选项云端初始化页的原布局。 */
#app .data-location-selection {
  box-sizing: border-box; width: min(680px, 100%); padding: 20px;
  max-height: calc(100dvh - 80px); overflow: auto;
  border: 1px solid #b8c7d9; border-radius: 10px;
}
#app .data-location-selection .data-location-heading {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; text-align: left;
}
#app .data-location-selection .data-location-heading h2 { margin: 0; font-size: 20px; font-weight: 400; }
#app .data-location-selection .data-location-heading .tag {
  padding: 5px 10px; border: 1px solid #c7d9f4; border-radius: 4px;
  color: #2865b7; background: #f2f6fc; font-size: 12px; white-space: nowrap;
}
#app .data-location-selection .data-location-description {
  margin: 10px 0 14px; color: #71839c; font-size: 14px; line-height: 1.8; text-align: left;
}
#app .data-location-selection .dialog-notice {
  position: static; display: flex; align-items: center; justify-content: flex-start;
  box-sizing: border-box; min-height: 0; margin: 0; padding: 10px 16px;
  font-size: 13px; line-height: 1.55; text-align: left; border-radius: 6px;
}
#app .data-location-selection .dialog-notice:focus { outline: none; }
#app .data-location-selection .dialog-notice.error { border-color: #e6bdb6; background: #fff7f5; color: #b64b42; }
#app .data-location-selection .cloud-initialization-options-two { margin-top: 16px; gap: 14px; }
#app .data-location-selection .cloud-initialization-option {
  box-sizing: border-box; min-height: 110px; padding: 16px 18px; gap: 7px;
  justify-content: flex-start; border: 1px solid #b8c7d9; border-radius: 7px; line-height: 1.75;
}
#app .data-location-selection .cloud-initialization-option strong { font-size: 18px; font-weight: 400; }
#app .data-location-selection .cloud-initialization-option span { font-size: 14px; line-height: 1.75; }
#app .data-location-selection .cloud-initialization-option:hover,
#app .data-location-selection .cloud-initialization-option:focus-visible { background: #f4f8ff; border-color: #7da7df; }
@media (max-width: 620px) {
  #app .data-location-selection { padding: 18px; }
  #app .data-location-selection .data-location-heading { gap: 10px; }
  #app .data-location-selection .data-location-heading h2 { font-size: 17px; }
  #app .data-location-selection .cloud-initialization-options-two { grid-template-columns: 1fr; gap: 12px; }
  #app .data-location-selection .cloud-initialization-option { min-height: 98px; }
}
