
/* ---------- 与首页胶囊行的联动（只在 body.lgppt-open 下生效） ---------- */
/* 模板区展开：一级行与二级行一起让位，只留「标签胶囊 + 模板区」。
   一级行的隐藏由能力包模块的 applyMode() 打上 .is-hidden 完成（见
   .lg-cap-first.is-hidden{display:none}），这里不再反向覆盖它。
   取消选择走输入框里标签胶囊的 ×（lg-cap-pill__x → clearAll）。 */
body.lgppt-open .chat-welcome .lg-cap-second.is-open { display: none !important; }
/* 分析 / 业务页签有各自的一级菜单，隐藏办公能力包的模板区 */
.chat-welcome.lg-biz-analysis .lgppt-inline,
.chat-welcome.lg-biz-business .lgppt-inline { display: none !important; }

/* ---------- 内联容器：挂在输入框下方，向下展开 ---------- */
.chat-welcome .lgppt-inline {
  display: block;
  width: 100%;
  max-width: 860px;
  margin: 14px auto 0;
  box-sizing: border-box;
  font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  animation: lgpptPanelIn .26s cubic-bezier(.22, 1, .36, 1) both;
}
.chat-welcome .lgppt-inline *,
.chat-welcome .lgppt-inline *::before,
.chat-welcome .lgppt-inline *::after { box-sizing: border-box; }
@keyframes lgpptPanelIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 类型 tab 行 ---------- */
.lgppt-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.lgppt-tabs::-webkit-scrollbar { display: none; }
.lgppt-tab {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 32px;
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: rgba(0, 0, 0, 0.62);
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.lgppt-tab:hover { background: #fafafa; border-color: rgba(0, 0, 0, 0.12); color: rgba(0, 0, 0, 0.82); }
.lgppt-tab.is-active {
  background: #1f2328;
  border-color: #1f2328;
  color: #fff;
}
.lgppt-tab.is-active:hover { background: #1f2328; color: #fff; }
/* 「更多」：仅展示，不做交互 */
.lgppt-tab--more {
  color: rgba(0, 0, 0, 0.32);
  cursor: default;
  gap: 3px;
}
.lgppt-tab--more:hover { background: #fff; border-color: rgba(0, 0, 0, 0.06); color: rgba(0, 0, 0, 0.32); }
.lgppt-tab--more svg { width: 12px; height: 12px; }
.lgppt-tabs__hint {
  margin-left: auto;
  flex: 0 0 auto;
  padding-left: 10px;
  font-size: 12px;
  line-height: 20px;
  color: rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

/* ---------- 卡片栅格：3 张一行 ---------- */
.lgppt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.lgppt-card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 0; margin: 0;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: transform .18s cubic-bezier(.22, 1, .36, 1), box-shadow .18s ease, border-color .18s ease;
  opacity: 0;
  animation: lgpptCardIn .3s cubic-bezier(.22, 1, .36, 1) forwards;
}
.lgppt-card:nth-child(1) { animation-delay: .02s; }
.lgppt-card:nth-child(2) { animation-delay: .06s; }
.lgppt-card:nth-child(3) { animation-delay: .1s; }
@keyframes lgpptCardIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lgppt-card:hover {
  transform: translateY(-2px);
  border-color: rgba(41, 112, 255, 0.34);
  box-shadow: 0 12px 26px rgba(15, 23, 42, .14);
}
.lgppt-card:focus-visible {
  outline: 2px solid #2970ff;
  outline-offset: 2px;
}
/* 已套用的模板 */
.lgppt-card.is-picked {
  border-color: #2970ff;
  box-shadow: 0 0 0 1px #2970ff inset, 0 6px 18px rgba(41, 112, 255, .14);
}
.lgppt-card__tag {
  position: absolute; left: 8px; top: 8px; z-index: 2;
  height: 19px; padding: 0 7px;
  display: inline-flex; align-items: center;
  border-radius: 6px;
  background: rgba(17, 23, 35, 0.78);
  color: #fff; font-size: 11px; font-weight: 500; line-height: 1;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.lgppt-card__b {
  display: flex; flex-direction: column; gap: 3px;
  padding: 9px 11px 11px;
}
.lgppt-card__t {
  font-size: 13px; font-weight: 600; line-height: 20px;
  color: rgba(0, 0, 0, 0.88);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lgppt-card__m {
  font-size: 11.5px; line-height: 17px;
  color: rgba(0, 0, 0, 0.42);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* hover 时在缩略图内浮出「使用此模板」（不遮挡卡片标题） */
.lgppt-card__use {
  position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 2;
  height: 30px;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border-radius: 8px;
  background: #2970ff; color: #fff;
  font-size: 12.5px; font-weight: 500; line-height: 1;
  opacity: 0; transform: translateY(6px);
  transition: opacity .16s ease, transform .18s cubic-bezier(.22, 1, .36, 1);
  pointer-events: none;
}
.lgppt-card__use svg { width: 13px; height: 13px; }
.lgppt-card:hover .lgppt-card__use,
.lgppt-card:focus-visible .lgppt-card__use { opacity: 1; transform: translateY(0); }

/* ---------- 缩略图：纯 CSS 迷你版式（16:9） ---------- */
.lgppt-sl {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  padding: 12px 13px;
  background: #fbfcfe;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
/* 兼容不支持 aspect-ratio 的内核 */
@supports not (aspect-ratio: 16 / 9) {
  .lgppt-sl { height: 148px; }
}
.lgppt-sl__h {
  display: block; height: 8px; width: 62%;
  border-radius: 3px;
  background: var(--lgppt-a, #2970ff);
}
.lgppt-sl__sub {
  display: block; height: 5px; width: 40%;
  margin-top: 7px; border-radius: 3px;
  background: rgba(15, 23, 42, 0.14);
}
.lgppt-sl__bar {
  position: absolute; left: 0; top: 0; right: 0; height: 4px;
  background: var(--lgppt-a, #2970ff);
  opacity: .9;
}
/* 封面型：标题 + 副标题 + 三点导航 */
.lgppt-sl--cover { display: flex; flex-direction: column; justify-content: center; padding-left: 16px; }
.lgppt-sl--cover .lgppt-sl__h { height: 11px; width: 72%; }
.lgppt-sl--cover .lgppt-sl__sub { width: 46%; }
.lgppt-sl__dots { position: absolute; right: 12px; bottom: 11px; display: flex; gap: 4px; }
.lgppt-sl__dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(15, 23, 42, 0.16);
}
.lgppt-sl__dots i:first-child { background: var(--lgppt-a, #2970ff); }
/* 图表型：标题 + 柱状图 */
.lgppt-sl__bars {
  position: absolute; left: 13px; right: 13px; bottom: 13px;
  height: 52%;
  display: flex; align-items: flex-end; gap: 7px;
}
.lgppt-sl__bars i {
  flex: 1 1 0;
  border-radius: 2px 2px 0 0;
  background: var(--lgppt-a, #2970ff);
  opacity: .34;
}
.lgppt-sl__bars i:nth-child(2) { opacity: .58; }
.lgppt-sl__bars i:nth-child(4) { opacity: 1; }
/* 图文型：标题 + 2×2 内容块 */
.lgppt-sl__cells {
  position: absolute; left: 13px; right: 13px; bottom: 13px;
  height: 54%;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px;
}
.lgppt-sl__cells i {
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.06);
  border-left: 2px solid var(--lgppt-a, #2970ff);
}
.lgppt-sl__cells i:nth-child(2),
.lgppt-sl__cells i:nth-child(3) { border-left-color: rgba(15, 23, 42, 0.14); }
/* 深色主题 */
.lgppt-sl.is-dark {
  background:
    radial-gradient(120% 90% at 85% 8%, color-mix(in srgb, var(--lgppt-a, #2970ff) 55%, transparent), transparent 60%),
    linear-gradient(155deg, #111827 0%, #1f2937 100%);
}
.lgppt-sl.is-dark .lgppt-sl__h { background: rgba(255, 255, 255, 0.92); }
.lgppt-sl.is-dark .lgppt-sl__sub { background: rgba(255, 255, 255, 0.34); }
.lgppt-sl.is-dark .lgppt-sl__cells i { background: rgba(255, 255, 255, 0.1); border-left-color: var(--lgppt-a, #2970ff); }
.lgppt-sl.is-dark .lgppt-sl__bars i { background: var(--lgppt-a, #2970ff); }
.lgppt-sl.is-dark .lgppt-sl__dots i { background: rgba(255, 255, 255, 0.24); }
.lgppt-sl.is-dark .lgppt-sl__dots i:first-child { background: #fff; }
/* 不支持 color-mix 时的兜底：纯深色渐变 */
@supports not (background: color-mix(in srgb, #000 50%, transparent)) {
  .lgppt-sl.is-dark { background: linear-gradient(155deg, #111827 0%, #263449 100%); }
}

/* ---------- 窄屏：卡片降为 2 列 ---------- */
@media (max-width: 720px) {
  .lgppt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lgppt-card:nth-child(3) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-welcome .lgppt-inline, .lgppt-card, .lgppt-card__use { transition: none !important; animation: none !important; opacity: 1; }
}
  