html, body, #root {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden; /* Disable global scrollbar */
  background-color: transparent !important; /* CRITICAL: Allow Wails window transparency */
}

body, #root {
  border-radius: 14px; /* Slightly rounded app window corners */
}

/* 侧边栏 Tree 样式优化 */
.ant-tree .ant-tree-treenode {
  width: 100%;
}

.ant-tree .ant-tree-node-content-wrapper {
  display: flex !important;
  align-items: center;
  white-space: nowrap;
  user-select: none !important;
  -webkit-user-select: none !important;
}

.ant-tree .ant-tree-title,
.ant-tree .ant-tree-treenode * {
  user-select: none !important;
  -webkit-user-select: none !important;
}

.ant-tree .ant-tree-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 8px;
}

/* Scrollbar styling for dark mode */
body[data-theme='dark'] ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
body[data-theme='dark'] ::-webkit-scrollbar-track {
    background: #1f1f1f;
}
body[data-theme='dark'] ::-webkit-scrollbar-corner {
    background: #1f1f1f;
}
body[data-theme='dark'] ::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 4px;
    border: 2px solid #1f1f1f;
}
body[data-theme='dark'] ::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Ensure body background matches theme to avoid white flashes, but kept transparent for window composition */
body {
    transition: color 0.3s;
}

body[data-theme='dark'] {
    /* Improve contrast on transparent backgrounds */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* 连接配置弹窗：滚动仅在弹窗 body 内部，不使用外层 wrap 滚动条 */
.connection-modal-wrap {
    overflow: hidden !important;
}

/* Custom Title Bar Close Button Hover */
.titlebar-close-btn:hover {
    background-color: #ff4d4f !important;
    color: #fff !important;
}
