/* 主入口图标 */
.entry-icon {
  position: fixed;
  top: 50%;
  right: 100px;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 1000;
  pointer-events: all;
}

.entry-icon img {
  width: 120px;
  height: 120px;
  display: block;
}

/* 弹出菜单容器 */
.entry-menu {
  display: none;
  position: fixed;
  z-index: 1001;
  pointer-events: all;
}

.entry-menu.show {
  display: block;
}

/* 菜单项 - 通用样式 */
.menu-item {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  transition:
    transform 0.3s,
    opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}

.entry-menu.show .menu-item {
  opacity: 1;
  pointer-events: all;
}

.menu-item img {
  width: 70px;
  max-width: none;
  object-fit: cover;
  margin-bottom: 8px;
}

.menu-item span {
  font-size: 14px;
  color: #333;
  font-weight: 500;
  white-space: nowrap;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 4px 12px;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 左侧菜单项 */
.menu-item-left {
  top: 50%;
  right: 240px;
  transform: translateY(-50%) translateX(20px);
}

.entry-menu.show .menu-item-left {
  transform: translateY(-50%) translateX(0);
}

/* 左下侧菜单项 */
.menu-item-bottom-left {
  top: calc(50% + 100px);
  right: 240px;
  transform: translateX(20px);
}

.entry-menu.show .menu-item-bottom-left {
  transform: translateX(0);
}

/* 悬停效果 */
.menu-item:hover {
  transform: translateY(-50%) translateX(-5px) !important;
}

.menu-item-bottom-left:hover {
  transform: translateX(-5px) !important;
}

/* .menu-item:hover img {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
} */

/* 关闭按钮 */
.close-btn {
  display: none;
  position: fixed;
  top: calc(50% + 120px);
  right: 130px;
  width: 40px;
  height: 40px;
  background-color: #999;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1002;
  pointer-events: all;
  transition:
    background-color 0.3s,
    transform 0.3s;
}

.close-btn::before,
.close-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 2px;
  background-color: #fff;
  transform-origin: center;
}

.close-btn::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.close-btn::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.close-btn:hover {
  background-color: #777;
  transform: scale(1.1);
}

.close-btn.show {
  display: none;
}

@media screen and (max-width: 767px) and (orientation: portrait) {
  .close-btn {
    top: calc(50% + 90px);
    right: 45px;
  }

  .entry-icon {
    right: 20px;
  }
}

/* ==========================================
   智能体面板与遮罩层样式
   ========================================== */

/* 遮罩层 */
.agent-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1005;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.agent-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* 侧边面板 */
.agent-panel {
  position: fixed;
  top: 0;
  right: -760px;
  /* 预留 10px 阴影溢出 */
  width: 750px;
  max-width: 95%;
  height: 100%;
  /*background-color: #fff;*/
  z-index: 1006;
  /*box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);*/
  transition: right 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
}

.agent-panel.show {
  right: 0;
}

/* 面板主体 */
.agent-panel-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.chat-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: unset;
}

.chat-iframe.scaled-75 {
  width: 133.333333%;
  height: 133.333333%;
  transform: scale(0.75);
  transform-origin: 0 0;
  position: absolute;
  top: 0;
  left: 0;
}

/* 悬浮关闭按钮（如在非缩放页面“游在中国”中使用） */
.agent-panel-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  cursor: pointer;
  z-index: 1010;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.agent-panel-close:hover {
  background: #fff;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.agent-panel-close::before,
.agent-panel-close::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 1.5px;
  background-color: #333;
  transition: background-color 0.2s;
}

.agent-panel-close::before {
  transform: rotate(45deg);
}

.agent-panel-close::after {
  transform: rotate(-45deg);
}

.agent-panel-close:hover::before,
.agent-panel-close:hover::after {
  background-color: #000;
}


/* 抽屉式手柄指示器（默认隐藏，仅在移动端展示） */
.drawer-handle {
  display: none;
}

@media screen and (max-width: 768px) {
  .drawer-handle {
    /*display: block;*/
    width: 40px;
    height: 5px;
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    margin: 10px auto 5px auto;
    flex-shrink: 0;
  }

  .agent-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 80% !important;
    border-radius: 16px 16px 0 0;
    /*box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);*/
    transform: translateY(calc(100% + 30px));
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  .agent-panel.show {
    transform: translateY(0) !important;
  }

  /* 移动端缩小主入口图标与菜单图标 */
  .entry-icon img {
    width: 90px;
    height: 90px;
  }

  .menu-item img {
    width: 60px;
  }
}