/* ── 服务器浏览器 ── */
.sb-page {
  display: flex;
  flex-direction: row;
  height: 100vh;
  overflow: hidden;
  padding-top: 0 !important;
  padding-left: 0;
}

.sb-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  padding-top: var(--app-topbar-safe-height); /* reserve space for the global app chrome */
}

.sb-main mdui-top-app-bar {
  position: static;
  flex-shrink: 0;
  display: none; /* replaced by .app-topbar */
}

.sb-content {
  box-sizing: border-box;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(20px * var(--sb-scale, 1.0)) 20px 132px;
  width: 100%;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--mdui-color-on-surface-variant), 0.34) transparent;
}

.sb-content::-webkit-scrollbar {
  width: 10px;
}

.sb-content::-webkit-scrollbar-track {
  background: transparent;
}

.sb-content::-webkit-scrollbar-thumb {
  min-height: 48px;
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(var(--mdui-color-on-surface-variant), 0.34);
  background-clip: content-box;
}

.sb-content::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--mdui-color-on-surface-variant), 0.52);
  background-clip: content-box;
}

.sb-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 120px;
}

.sb-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.sb-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: rgb(var(--mdui-color-on-surface));
}

.sb-add-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 24px;
  padding: 16px;
  background: rgb(var(--mdui-color-surface-variant));
  border-radius: 12px;
  flex-wrap: wrap;
}

.sb-input {
  flex-shrink: 0;
}

.sb-input.wide {
  flex: 1;
  min-width: 200px;
}

.sb-input[label="名称"] {
  width: 120px;
}

.sb-input[label="地址（IP 或域名）"] {
  flex: 1;
  min-width: 250px;
}

.sb-input[label="端口"] {
  width: 100px;
}

.sb-loading {
  display: flex;
  justify-content: center;
  padding: 60px 0;
}

.sb-empty {
  text-align: center;
  padding: 60px 0;
  color: rgb(var(--mdui-color-on-surface-variant));
  font-size: 14px;
}

.sb-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(280px * var(--sb-scale, 1.0)), 1fr));
  gap: calc(16px * var(--sb-scale, 1.0));
  margin-top: calc(16px * var(--sb-scale, 1.0));
  position: relative;
}

/* 分组 */
.sb-group {
  margin-bottom: calc(32px * var(--sb-scale, 1.0));
  position: relative;
}

.sb-group--collapsed .sb-cards-grid,
.sb-group--collapsed .sb-empty {
  height: 0 !important;
  min-height: 0 !important;
  margin-top: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.sb-group-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgb(var(--mdui-color-outline-variant));
}

.sb-group-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: rgb(var(--mdui-color-on-surface));
  margin-right: 4px;
}
