// 全屏底部抽屉
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  // 遮罩背景
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
  overflow: hidden;

  &.overlayVisible {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.3);
  }

  &.overlayCollapsed {
    pointer-events: none;
    background: rgba(0, 0, 0, 0);
  }
}


// 与 .body 渐变顶部一致，拖拽把手区与主内容区同色（避免一条白底）
@sheetContentTopBg: #edf4ff;

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100% - 60px);
  max-height: calc(100% - 60px);
  background: #fff;
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  pointer-events: auto;
}

.sheetCollapsed {
  max-height: 665px;
  background: linear-gradient(
    to bottom,
    rgba(245, 247, 250, 0.65) 0%,
    #f5f7fa 13.3%,
    #f5f7fa 100%
  );
  border-radius: 24px 24px 0 0;
}

// 拖动把手区域
.handle {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 32px;
  padding-top: 12px;
  cursor: grab;
  background: @sheetContentTopBg;
  position: relative;
}

.handleCollapsed {
  flex-direction: column;
  gap: 16px;
  padding: 12px 0;
  background: transparent;
}

.handleBar {
  width: 70px;
  height: 5px;
  background: #b0b2b8;
  border-radius: 75px;
}

// 历史问答分隔线 + 胶囊按钮
.historyHandle {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 35px;
}

.historyDivider {
  position: absolute;
  left: 11px;
  right: 11px;
  top: 50%;
  height: 0;
  border-top: 1px solid #ebebeb;
}

.historyPill {
  position: relative;
  z-index: 1;
  width: 170px;
  height: 35px;
  padding: 0;
  border: 1px solid #ebebeb;
  border-radius: 49px;
  background: rgba(255, 255, 255, 0.39);
  font-family: 'Source Han Sans CN', 'PingFang SC', sans-serif;
  font-size: 24px;
  line-height: 38px;
  color: rgba(0, 2, 6, 0.6);
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  &:active {
    opacity: 0.7;
  }
}

// 收起态（历史问答）右上角关闭按钮
.closeBtnCollapsed {
  position: absolute;
  top: 12px;
  right: 28px;
  z-index: 10;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  &:active {
    opacity: 0.6;
  }
}

// 导航栏
.navbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: 96px;
  padding: 0 24px;
  position: relative;
  background: #fff;
}

.backBtn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.navTitle {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'PingFang SC', sans-serif;
  font-size: 32px;
  font-weight: 600;
  line-height: 52px;
  color: rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  max-width: calc(100% - 120px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.navRight {
  margin-left: auto;
}

// hideNavbar 模式下的右上角关闭按钮
.closeBtn {
  position: absolute;
  top: 20px;
  right: 28px;
  z-index: 10;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  &:active {
    opacity: 0.6;
  }
}

// 内容区（欢迎页 or 消息列表）
.body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(
      180deg,
      rgba(57, 128, 244, 0) 36%,
      rgba(57, 128, 244, 0.15) 60%,
      rgba(57, 128, 244, 0) 80%
    ),
    linear-gradient(180deg, @sheetContentTopBg 0%, @sheetContentTopBg 35%, #fff 65%);

  // 触发 GPU 加速，提升滚动流畅度
  will-change: scroll-position;
  transform: translateZ(0);

  &::before,
  &::after {
    content: '';
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(48px);
    opacity: 0.4;
    z-index: 0;
  }

  &::before {
    width: 492px;
    height: 460px;
    right: -120px;
    top: -33px;
    background: radial-gradient(circle, rgba(84, 113, 246, 0.25) 0%, transparent 65%);
  }

  &::after {
    width: 506px;
    height: 494px;
    left: -117px;
    top: -133px;
    background: radial-gradient(circle, rgba(0, 132, 255, 0.2) 0%, transparent 65%);
  }

  & > * {
    position: relative;
    z-index: 1;
  }
}
