/* 工作台首页：去快捷入口 · 最近授课弹层 · 加高聊天区 */

#teacher-app #panel-home .home-ai-feature-chips {
  display: none !important;
}

#teacher-app #panel-home > .tp-section-head,
#teacher-app #panel-home > .lesson-grid#homeLessonGrid,
#teacher-app #panel-home > #homeLessonGrid {
  display: none !important;
}

#teacher-app #panel-home .home-chat-panel {
  display: flex !important;
  flex-direction: column !important;
  min-height: min(720px, calc(100vh - 168px)) !important;
  max-height: calc(100vh - 140px);
  margin-bottom: 12px !important;
  border-radius: 18px !important;
  border: 1px solid #e4e1f2 !important;
  background: linear-gradient(160deg, #ffffff 0%, #faf9ff 55%, #f7f8ff 100%) !important;
  box-shadow: 0 10px 28px rgba(72, 64, 120, 0.06) !important;
  overflow: hidden !important;
}

#teacher-app #panel-home .home-chat-head {
  flex: 0 0 auto;
  padding: 18px 22px 14px !important;
  border-bottom: 1px solid #efeef6;
}

#teacher-app #panel-home .home-chat-panel:not(.has-conversation) .home-ai-msgs,
#teacher-app #panel-home .home-ai-msgs {
  display: flex !important;
  flex-direction: column;
  flex: 1 1 auto !important;
  min-height: min(420px, 48vh) !important;
  max-height: none !important;
  margin: 0 18px !important;
  padding: 16px 14px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  overflow-y: auto;
  gap: 10px;
}

#teacher-app #panel-home .home-ai-msgs .msg {
  font-size: 14px;
  line-height: 1.65;
  max-width: min(92%, 720px);
}

#teacher-app #panel-home .home-ai-msgs .msg-bot {
  align-self: flex-start;
  background: #f3f1fb;
  border: 1px solid #e8e4f6;
  border-radius: 14px 14px 14px 6px;
  padding: 10px 14px;
  color: #3f3d55;
}

#teacher-app #panel-home .home-ai-msgs .msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #6f5fd0, #5b6fe0);
  color: #fff;
  border-radius: 14px 14px 6px 14px;
  padding: 10px 14px;
}

#teacher-app #panel-home .home-ai-foot {
  flex: 0 0 auto;
  padding: 12px 18px 18px !important;
  border-top: 1px solid #efeef6;
  background: rgba(255, 255, 255, 0.72);
}

#teacher-app #panel-home .tp-composer {
  border: 1px solid #d8d3ef !important;
  border-radius: 14px !important;
  padding: 14px 16px 12px !important;
  background: #fff !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

#teacher-app #panel-home .tp-composer:focus-within {
  border-color: #9b8ce0 !important;
  box-shadow: 0 0 0 3px rgba(111, 95, 208, 0.12) !important;
}

#teacher-app #panel-home #homeAiInput {
  min-height: 84px !important;
  max-height: 220px !important;
  font-size: 14.5px !important;
  line-height: 1.7 !important;
}

#teacher-app #btnHomeRecentLessons {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid #e2dfef;
  background: rgba(255, 255, 255, 0.85);
  color: #5c5878;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}

#teacher-app #btnHomeRecentLessons:hover {
  border-color: #b9aee8;
  background: #f4f1ff;
  color: #5a4db8;
}

#teacher-app #btnHomeRecentLessons .tp-icon {
  width: 15px;
  height: 15px;
}

/* 最近授课居中弹层 */
#tpHomeRecentModal.tp-home-recent-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(28, 27, 45, 0.42);
  backdrop-filter: blur(2px);
}

#tpHomeRecentModal.tp-home-recent-modal.is-open {
  display: flex;
}

#tpHomeRecentModal .tp-home-recent-panel {
  width: min(1080px, 100%);
  max-height: min(86vh, 860px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e7e4f3;
  box-shadow: 0 24px 64px rgba(30, 24, 70, 0.22);
  overflow: hidden;
}

#tpHomeRecentModal .tp-home-recent-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid #efeef6;
}

#tpHomeRecentModal .tp-home-recent-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 650;
  color: #2f2d45;
}

#tpHomeRecentModal .tp-home-recent-head p {
  margin: 0;
  font-size: 12px;
  color: #8c8d9f;
}

#tpHomeRecentModal .tp-home-recent-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#tpHomeRecentModal .tp-home-recent-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 18px 22px 22px;
}

#tpHomeRecentModal #homeLessonGrid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

#tpHomeRecentModal #homeLessonGrid .lesson-card {
  min-width: 0;
}

@media (max-width: 900px) {
  #teacher-app #panel-home .home-chat-panel {
    min-height: min(640px, calc(100vh - 120px)) !important;
  }
  #teacher-app #panel-home .home-ai-msgs {
    min-height: min(320px, 42vh) !important;
  }
  #tpHomeRecentModal #homeLessonGrid {
    grid-template-columns: 1fr;
  }
}

/* === home chat bubble polish === */
#teacher-app #panel-home .home-ai-msgs {
  gap: 14px !important;
}

#teacher-app #panel-home .home-ai-msgs .msg {
  max-width: min(94%, 560px);
}

#teacher-app #panel-home .home-ai-msgs .msg-bot {
  width: fit-content;
  max-width: min(94%, 560px);
  padding: 12px 16px 14px !important;
  background: #f6f5fb !important;
  border: 1px solid #ebe7f6 !important;
  border-radius: 16px 16px 16px 6px !important;
  color: #3a3850 !important;
  box-shadow: none !important;
}

#teacher-app #panel-home .home-ai-msgs .msg-bot .ai-chat-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#teacher-app #panel-home .home-ai-msgs .msg-bot .ai-chat-p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: #3a3850;
}

#teacher-app #panel-home .home-ai-msgs .msg-bot .ai-chat-p strong {
  font-weight: 650;
  color: #2f2c48;
}

#teacher-app #panel-home .home-ai-msgs .msg-bot .ai-chat-list {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#teacher-app #panel-home .home-ai-msgs .msg-bot .ai-chat-list > li {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e8e4f4;
  font-size: 13.5px;
  line-height: 1.55;
  color: #45425e;
  box-shadow: 0 1px 0 rgba(72, 64, 120, 0.03);
}

#teacher-app #panel-home .home-ai-msgs .msg-bot .ai-chat-list > li strong {
  font-weight: 650;
  color: #5b4fc9;
  margin-right: 2px;
}

#teacher-app #panel-home .home-ai-msgs .msg-bot .msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e8e4f4;
}

#teacher-app #panel-home .home-ai-msgs .msg-bot .msg-actions .btn {
  min-height: 34px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: none;
}

#teacher-app #panel-home .home-ai-msgs .msg-bot .msg-actions .btn-primary {
  background: linear-gradient(135deg, #6f5fd0, #5b6fe0);
  border-color: transparent;
}

#teacher-app #panel-home .home-ai-msgs .msg-bot .msg-actions .btn-primary:hover {
  filter: brightness(1.04);
}

#teacher-app #panel-home .home-ai-msgs .msg-user {
  width: fit-content;
  max-width: min(86%, 480px);
  padding: 10px 14px !important;
}

/* === swap choice actions === */
#teacher-app #panel-home .home-ai-msgs .msg-bot .msg-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e8e4f4;
}

#teacher-app #panel-home .home-ai-msgs .msg-bot .msg-actions .btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.45;
  white-space: normal;
}

/* 多选项：白底卡片，别做成一排大紫钮 */
#teacher-app #panel-home .home-ai-msgs .msg-bot .msg-actions .btn-primary {
  background: #fff !important;
  color: #3a3850 !important;
  border: 1px solid #e8e4f4 !important;
  box-shadow: 0 1px 0 rgba(72, 64, 120, 0.03);
}

#teacher-app #panel-home .home-ai-msgs .msg-bot .msg-actions .btn-primary:hover {
  border-color: #cfc7f0 !important;
  background: #f8f6ff !important;
  color: #4f46a5 !important;
  filter: none;
}

/* 单个确认钮保持紫色强调 */
#teacher-app #panel-home .home-ai-msgs .msg-bot .msg-actions .btn-primary:only-child {
  background: linear-gradient(135deg, #6f5fd0, #5b6fe0) !important;
  color: #fff !important;
  border-color: transparent !important;
  justify-content: center;
  text-align: center;
  font-weight: 600;
}
