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: 10px 12px;
  background: #fafafa;
  -webkit-overflow-scrolling: touch;
}

.train-page .msg {
  max-width: 72%;
  padding: 8px 12px;
  border-radius: 12px;
  margin: 6px 0;
  white-space: pre-wrap;
  line-height: 1.8;
  font-size: 15px;
}

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

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

.train-page .composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px;
  border-top: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  background: transparent;
  z-index: 101;
}

.train-page #input {
  flex: 0 1 760px;
  width: min(760px, calc(100% - 56px));
  resize: none;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #e3e3e3;
  background: #fff;
  font-size: 15px;
  line-height: 1.45;
  outline: none;
  min-height: 42px;
  max-height: 66vh;
  overflow-y: hidden;
}

.train-page #send {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: #d8e2f0;
  color: #4b5b73;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.train-page #send:disabled {
  cursor: not-allowed;
  opacity: .7;
}

.train-page #send .send-arrow,
.train-page #send .send-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.train-page #send .send-arrow {
  color: #4b5f7a;
  transform: translateY(1px);
}

.train-page #send .send-arrow-icon {
  width: 26px;
  height: 26px;
  display: block;
}

.train-page #send .send-arrow-icon path {
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.train-page #send .send-dots {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 1.5px;
  transform: translateY(-2px);
  color: #4b5f7a;
}

.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: center;
  gap: 4px;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 6px;
  margin-bottom: 2px;
  min-height: 36px;
}

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

.train-page .session-item.active {
  background: #eaeaea;
}

.train-page .session-item.active .session-item-date,
.train-page .session-item.active .session-item-clock {
  color: #666;
  font-weight: 600;
}

.train-page .session-item-main {
  flex: 1;
  min-width: 0;
  width: 100%;
  align-self: stretch;
  display: flex;
  align-items: center;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 1px 0 1px 10px;
  cursor: pointer;
}

.train-page .session-item-title {
  display: block;
  width: 100%;
  font-size: 14px;
  font-weight: 500;
  color: #111;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.train-page .session-item-meta {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  margin: 0 10px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.train-page .session-item-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  min-width: 44px;
  font-size: 11px;
  line-height: 1;
  color: #999;
  transition: opacity .16s ease;
  pointer-events: none;
}

.train-page .session-item-date {
  display: block;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
  margin-top: 1px;
}

.train-page .session-item-clock {
  display: block;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
  margin-top: 1px;
}

.train-page .session-item-more {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  text-align: center;
  color: #777;
  font-size: 18px;
  line-height: 1;
  opacity: 0;
  transition: opacity .16s ease;
  pointer-events: none;
}

.train-page .session-item-meta:hover .session-item-time {
  opacity: 0.18;
}

.train-page .session-item-meta:hover .session-item-more {
  opacity: 1;
}

.train-page .session-item.active .session-item-time {
  opacity: 1;
}

.train-page .session-item.active .session-item-more {
  opacity: 0;
}

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

.train-page .session-item-menu.menu-down {
  top: calc(100% + 6px);
  bottom: auto;
}

.train-page .session-item-menu.menu-up {
  bottom: calc(100% + 6px);
  top: auto;
}

.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;
  font-weight: 500;
  line-height: 1.25;
  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-content-width: 720px;
    --train-input-width: 680px;
  }

  .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;
  }

  .train-page .chat {
    padding-top: 18px;
    padding-bottom: 18px;
    padding-left: max(24px, calc((100vw - var(--train-left-width) - var(--train-content-width)) / 2));
    padding-right: max(24px, calc((100vw - var(--train-left-width) - var(--train-content-width)) / 2));
  }

  .train-page .msg {
    max-width: min(680px, 88%);
  }

  .train-page .composer {
    padding: 12px max(20px, calc((100vw - var(--train-left-width) - var(--train-content-width)) / 2));
  }

  .train-page #input {
    flex-basis: var(--train-input-width);
    width: min(var(--train-input-width), calc(100% - 56px));
  }
}
