@import '../common.less';

/* 主布局容器 */
.playground-container {
  width: 100%;
  height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  padding-top: @header-height;
  padding-bottom: 0;
  min-width: 300px;
  max-width: @container-width-max;
  margin: 0 auto;
  box-sizing: border-box;
  overflow: hidden;
}

.playground-container.vertical-mode {
  height: 100vh;
}

/* 头部导航栏 */
.header-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: @header-height;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 @side-horizontal-padding;
  box-shadow: @box-shadow-base;
  z-index: 1000;
  max-width: @container-width-max;
  margin: 0 auto;
  box-sizing: border-box;
  border-bottom: 1px solid @border-color;
  width: 100%;
}

/* 顶部工具栏 - 类似清言 */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 15px;
  background-color: #f8f8f8;
  border-bottom: 1px solid @border-color;
  margin-bottom: 10px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: @border-radius-circle;
  background-color: #fff;
  border: 1px solid @border-color;
  color: @text-secondary;
  cursor: pointer;
  transition: @transition-fast;
}

.tool-button:hover {
  background-color: @primary-color;
  color: #fff;
  border-color: @primary-color;
}

/* Logo 容器 */
.logo-container {
  display: flex;
  align-items: center;
}

.midscene-logo {
  width: 24px;
  height: 24px;
  margin-right: 8px;
  object-fit: contain;
}

.logo-text {
  font-size: 14px;
  font-weight: 600;
  color: @text-primary;
}

/* 头部操作区 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 内容主区域 - 类似聊天界面 */
.playground-content {
  padding: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  background-color: #ffffff;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* 修改布局，确保顶部和底部元素分离 */
  min-height: 0;
}

/* 聊天界面中间部分 */
.conversation-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin-top: 0;
  position: relative;
  height: 100%;
}

/* 任务列表容器 */
.tasks-container {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  padding-bottom: 120px; /* 增加底部内边距，确保内容不被底部按钮遮挡 */
  padding-top: 6px; /* 与components/layout.less保持一致 */
  height: auto; /* 移除固定高度，允许容器跟随内容自适应 */
  max-height: 100%; /* 确保不超过父容器高度 */
  position: relative; /* 添加相对定位 */
  top: 0; /* 确保从顶部开始显示 */
}

/* 任务列表项容器 - 修复溢出问题 */
.task-list-card {
  height: auto;
  max-height: none;
  overflow: visible;
}

.task-list-card .ant-card-body {
  overflow-y: visible;
  max-height: none;
}

.tasks-container .ant-list {
  overflow: visible;
}

/* 知识库容器样式 */
.empty-knowledge-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  max-width: 340px; /* 与tasks-container和底部输入框宽度保持一致 */
  padding: 0;
  position: relative;
  left: 0;
  right: 0;
}

/* 底部输入区固定在底部 */
.footer-input-area {
  width: 100%;
  margin: 0 auto;
  padding: 20px 0 8px; /* 增加顶部内边距，减少与按钮的重叠 */
  box-sizing: border-box;
  background-color: #ffffff;
  border-top: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 340px; /* 与任务列表和知识库组件保持一致 */
  position: relative;
  z-index: 10; /* 确保底部输入区在滚动内容之上 */
}

/* 输入框包装器 */
.input-wrapper {
  width: 100%;
  padding: 0;
  box-sizing: border-box;
}

/* 无缝表单 */
.seamless-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
  height: calc(100vh - @header-height);
  overflow: hidden;
}

/* 任务列表包装 */
.task-wrapper {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 10px;
}

/* 弹窗样式 */
.settings-modal .ant-modal-header {
  border-bottom: 1px solid @border-color;
}

.settings-modal .ant-modal-title {
  font-weight: 600;
  font-size: 16px;
  color: @text-primary;
}

/* 响应式调整 */
@media (max-width: 450px) {
  .playground-container {
    min-width: 100%;
  }
} 