/* 官网 iframe 适配：保持原界面比例，只处理容器收缩和常见小视口。 */
html,
body,
#root {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.app-layout,
.app-layout__main,
.app-layout__sidebar-wrapper,
.session-sidebar,
.session-sidebar__scroll-container {
  min-width: 0;
  min-height: 0;
}

.app-layout {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
}

/* 跨模块切换直接落到目标态，避免顶部选中药丸的 300ms 横向弹动。 */
.sidebar-tab-switcher__slider {
  transition: none !important;
}

.app-layout__sidebar-wrapper,
.session-sidebar {
  width: clamp(240px, 22vw, 280px) !important;
}

.session-sidebar__scroll-container {
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.chat-welcome {
  padding-top: clamp(88px, 15vh, 148px) !important;
}

.chat-welcome-inner {
  width: min(710px, calc(100% - clamp(32px, 6vw, 72px))) !important;
  max-width: calc(100% - clamp(32px, 6vw, 72px)) !important;
  min-width: 0;
}

@media (max-height: 760px) {
  .session-sidebar__header {
    min-height: 58px !important;
    padding-top: 12px !important;
    padding-bottom: 8px !important;
  }

  .session-sidebar__nav-btn {
    min-height: 34px !important;
  }

  .lg-showcase-panel {
    padding-top: 8px;
    padding-bottom: 10px;
  }

  .lg-showcase-section + .lg-showcase-section {
    margin-top: 8px;
  }

  .lg-showcase-row {
    min-height: 28px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
}

@media (max-width: 1024px) {
  .app-layout__sidebar-wrapper,
  .session-sidebar {
    width: 232px !important;
  }

  .chat-welcome {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .chat-welcome-inner {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
  }

  .session-sidebar__tab {
    min-width: 0;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}

/* 官网静态展示收口：侧栏任务完整展示但无交互，指定开发入口保持不可用。 */
.session-sidebar__history-section,
.session-sidebar__history-tabs {
  display: none !important;
}

.lg-showcase-panel {
  flex: 0 0 auto;
  padding: 12px 10px 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.82);
  pointer-events: none;
  user-select: none;
}

.lg-showcase-section + .lg-showcase-section {
  margin-top: 14px;
}

.lg-showcase-head {
  display: flex;
  align-items: center;
  height: 26px;
  padding: 0 5px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.82);
}

.lg-showcase-subhead {
  padding: 7px 8px 4px;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.42);
}

.lg-showcase-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lg-showcase-row {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 18px;
  color: rgba(0, 0, 0, 0.72);
  background: transparent;
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lg-showcase-row::before {
  content: "";
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
}

.lg-showcase-row--folder {
  color: rgba(0, 0, 0, 0.68);
  font-weight: 500;
  background: rgba(0, 0, 0, 0.025);
}

.lg-showcase-row--folder::before {
  width: 13px;
  height: 10px;
  border-radius: 2px;
  background: rgba(41, 112, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(41, 112, 255, 0.24);
}

.lg-showcase-row--child {
  min-height: 28px;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 29px;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.52);
}

.lg-showcase-row--child::before {
  width: 4px;
  height: 4px;
}

.lg-showcase-row--auto::before {
  background: #7c8cff;
}

.lg-static-unavailable {
  opacity: 0.48 !important;
  cursor: default !important;
  pointer-events: none !important;
  filter: grayscale(0.2);
}

/* 技能开发仅关闭交互，视觉与其他开发入口保持一致。 */
.lg-dev-mode[data-key="skill"].lg-static-unavailable,
body[data-scope-module="开发"] .session-sidebar__nav-btn.lg-static-unavailable {
  opacity: 1 !important;
  filter: none !important;
}

/* 工作模块技能卡片使用与常规产品卡片一致的紧凑文字层级。 */
body[data-scope-module="工作"] .skd-demo .skd-card__name {
  font-size: 14px !important;
  line-height: 20px !important;
}

body[data-scope-module="工作"] .skd-demo .skd-card__desc {
  font-size: 12px !important;
  line-height: 18px !important;
}

body[data-scope-module="工作"] .skd-demo .skd-card__icon {
  font-size: 16px !important;
}

.dev-projects__actions,
.dev-projects__action {
  display: none !important;
}

body[data-scope-module="开发"] .dev-projects {
  display: none !important;
}

/* 管理是无路由覆盖层：隐藏底层开发路由的项目区与原生分割线，
   侧栏只显示办公室树、管理专属业务流程和底部用户区。 */
body.lingee-org-as-chat .session-sidebar .dev-projects,
body.lingee-org-as-chat .session-sidebar .session-sidebar__divider {
  display: none !important;
}

/* 与工作「新建任务」及开发「新会话」保持相同的 12px 顶部呼吸间距。 */
body.lingee-org-as-chat .session-sidebar [data-lof-org-host] {
  padding-top: 12px !important;
}

/* 无路由方案的办公室树位于原生 nav-section 内；抵消该容器的 12px 横向内边距，
   恢复旧版直接挂在侧栏时的左对齐与宽度。 */
body.lingee-org-as-chat .session-sidebar [data-lof-org-host] > #lof-nav-group {
  margin-left: -12px;
  margin-right: -12px;
}

/* nav-section 自带 2px 项间距，顶部 margin 相应减 2px，保持旧版分隔线坐标。 */
body.lingee-org-as-chat .session-sidebar [data-lof-org-host] > #lof-divider-top {
  margin: 6px 2px 8px;
}

[data-theme="dark"] .lg-showcase-panel {
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
}

[data-theme="dark"] .lg-showcase-head {
  color: rgba(255, 255, 255, 0.82);
}

[data-theme="dark"] .lg-showcase-subhead {
  color: rgba(255, 255, 255, 0.42);
}

[data-theme="dark"] .lg-showcase-row {
  color: rgba(255, 255, 255, 0.68);
}

[data-theme="dark"] .lg-showcase-row--folder {
  color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .lg-showcase-row--child {
  color: rgba(255, 255, 255, 0.48);
}
