/* 自定义标题栏样式 */
.custom-title-bar {
  height: 40px;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  user-select: none;
  flex-shrink: 0;
  z-index: 1000;
}

.title-bar-drag-region {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  -webkit-app-region: drag; /* 启用拖拽 */
}

.title-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
}

/* macOS: 为原生窗口控制按钮留出空间 */
.custom-title-bar.mac .title-bar-left {
  padding-left: 78px; /* 为原生红黄绿按钮留出空间 */
}

.title-bar-right {
  display: flex;
  align-items: center;
  padding-right: 0;
}

.title-bar-button,
.title-bar-control-button {
  -webkit-app-region: no-drag; /* 禁用按钮区域的拖拽 */
  width: 48px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  font-size: 12px;
  transition: all 0.2s ease;
}

.title-bar-button {
  border-radius: 4px;
  margin-right: 4px;
}

.title-bar-button:hover {
  background-color: #e6f7ff;
  color: #1890ff;
}

.title-bar-control-button {
  width: 48px !important;
  height: 40px;
  border-radius: 0;
}

.title-bar-control-button:hover {
  background-color: #e0e0e0;
}

.title-bar-close-button:hover {
  background-color: #e81123;
  color: #fff;
}

.title-bar-title {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  color: #333;
  line-height: 1;
}
