body.train-page {
  color: #111;
  background: #fafafa;
  font-size: 16px;
  height: 100vh;
  overflow: hidden;
}

.train-page .hidden {
  display: none !important;
}

.train-page .topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  padding: 0 14px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  font-size: 16px;
  z-index: 100;
}

.train-page .menu-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #333;
  flex-shrink: 0;
}

.train-page .topbar-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 220px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  color: #111;
}

.train-page .topbar-right {
  min-width: 72px;
  max-width: 120px;
  text-align: center;
  font-size: 15px;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}
.train-page .topbar-right:hover { background: #ededed; }
.train-page .topbar-action {
  appearance: none;
}

.train-page .chat {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 68px;
  overflow-y: auto;
  padding: 12px;
  background: #fafafa;
  -webkit-overflow-scrolling: touch;
}

.train-page .msg {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 12px;
  margin: 8px 0;
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 16px;
}

.train-page .msg.user {
  margin-left: auto;
  background: #dbeafe;
}

.train-page .msg.assistant {
  margin-right: auto;
  background: #fff;
  border: 1px solid #eee;
}

.train-page .composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  border-top: 1px solid #eee;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: #fff;
  z-index: 101;
}

.train-page #input {
  flex: 1;
  resize: none;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #ddd;
  font-size: 16px;
  line-height: 1.5;
  outline: none;
  min-height: 44px;
  max-height: 66vh;
  overflow-y: hidden;
}

.train-page #send {
  width: 92px;
  height: 44px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  background: #e9e9e9;
  color: #111;
  font-size: 16px;
  flex-shrink: 0;
}
.train-page #send:disabled { cursor: not-allowed; opacity: .6; }

.train-page .drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.28);
  z-index: 1000;
}

.train-page .drawer-actions {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f1f1;
}

.train-page .drawer-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  padding: 0 14px;
  border-bottom: 1px solid #eee;
}

.train-page .drawer-head-left,
.train-page .drawer-head-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.train-page .drawer-head-left { left: 14px; }
.train-page .drawer-head-right { right: 14px; }

.train-page .drawer-title {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.train-page .drawer-toggle-btn {
  width: 36px;
  height: 36px;
}

.train-page .session-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(360px, 82vw);
  max-width: 360px;
  height: 100vh;
  background: #fff;
  z-index: 1001;
  box-shadow: 2px 0 18px rgba(0,0,0,.12);
  display: flex;
  flex-direction: column;
}

.train-page .new-session-btn {
  width: 100%;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
}

.train-page .session-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.train-page .session-empty {
  color: #999;
  font-size: 16px;
  text-align: center;
  padding: 20px 0;
}

.train-page .session-item {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  border: 1px solid #eee;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 10px;
}

.train-page .session-item.active {
  border-color: #4CAF50;
  background: #f7fff7;
}

.train-page .session-item-main {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.train-page .session-item-title {
  font-size: 16px;
  color: #111;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.train-page .session-item-time {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.3;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.train-page .session-item-more {
  flex: 0 0 36px;
  width: 36px;
  margin: 8px 8px 8px 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #777;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.train-page .session-item-more:hover {
  background: #f3f4f6;
}

.train-page .session-item-menu {
  position: absolute;
  top: 44px;
  right: 8px;
  min-width: 120px;
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
  z-index: 12;
}

.train-page .session-item-menu-btn {
  width: 100%;
  height: 36px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  text-align: left;
  padding: 0 10px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
}

.train-page .session-item-menu-btn:hover {
  background: #f4f4f5;
}

.train-page .session-item-menu-btn.danger {
  color: #b42318;
}

.train-page .session-item-menu-btn.danger:hover {
  background: #fef3f2;
}

.train-page .user-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.28);
  z-index: 1002;
}

.train-page .user-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 92vw);
  max-width: 420px;
  height: 100vh;
  background: #fff;
  z-index: 1003;
  box-shadow: -2px 0 18px rgba(0,0,0,.12);
  display: flex;
  flex-direction: column;
}

.train-page .user-drawer-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  padding: 0 14px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.train-page .user-drawer-head-left {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 110px;
  height: 40px;
}

.train-page .user-drawer-title {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.train-page .drawer-close-link {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.train-page .user-drawer-frame {
  width: 100%;
  height: calc(100vh - 60px);
  border: 0;
  display: block;
  background: #fff;
}

@media (max-width: 768px) {
  .train-page .session-drawer,
  .train-page .user-drawer {
    width: 100vw;
    max-width: none;
  }
  .train-page .user-drawer-head-left { width: 82px; }
}

/* ===== 训练页桌面端共通布局：左侧会话栏固定，右侧聊天区 ===== */
@media (min-width: 960px) {
  .train-page {
    --train-left-width: 320px;
  }

  .train-page .topbar,
  .train-page .chat,
  .train-page .composer {
    left: var(--train-left-width);
  }

  .train-page .session-drawer {
    display: flex !important;
    width: var(--train-left-width);
    max-width: var(--train-left-width);
    box-shadow: none;
    border-right: 1px solid #eee;
  }

  .train-page .drawer-mask {
    display: none !important;
  }
}
