#page-chat.active { display: flex; flex-direction: column; overflow: hidden; }
.coach-profile-bar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0 var(--space-5); flex: 0 0 auto; }
.cp-avatar, .ce-avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: var(--radius-pill); background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.cp-name { color: var(--text); font-size: 22px; font-weight: 700; }
.cp-subtitle { margin-top: var(--space-1); color: var(--text-secondary); font-size: 12px; }
.cp-collapse { margin-left: auto; min-height: 44px; padding: var(--space-3); border: 0; border-radius: var(--radius-sm); color: var(--primary); background: var(--primary-soft); font-size: 12px; cursor: pointer; }
.coach-insights { flex: 0 0 auto; padding: var(--space-4); margin-bottom: var(--space-3); border-radius: var(--radius-md); background: var(--primary-soft); }
.coach-insights.collapsed { display: none; }
.ci-row { display: flex; align-items: flex-start; gap: var(--space-3); font-size: 13px; line-height: 1.6; padding: var(--space-1) 0; }
.ci-index { color: var(--primary); font-size: 11px; }
.quick-actions { display: flex; flex: 0 0 auto; gap: var(--space-2); margin-bottom: var(--space-3); overflow-x: auto; scrollbar-width: thin; }
.qa-btn { flex: 0 0 auto; min-height: 44px; padding: var(--space-3) var(--space-4); border: 0; border-radius: var(--radius-pill); background: var(--surface-card); color: var(--text-secondary); font-size: 13px; cursor: pointer; }
.qa-btn span { display: none; }
.chat-section { display: flex; flex: 1 1 0; flex-direction: column; min-height: 0; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface-card); box-shadow: var(--shadow-card); }
.chat-messages { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: var(--space-6); overscroll-behavior-y: contain; }
.chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3); min-height: 100%; padding: var(--space-4) 0; text-align: center; }
.ce-avatar { width: 64px; height: 64px; font-size: 24px; flex-basis: 64px; }
.chat-empty h3 { margin-top: var(--space-3); font-size: 24px; }
.ce-text { color: var(--text-secondary); font-size: 14px; }
.chat-empty-prompts { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.chat-empty-prompts button { min-height: 44px; padding: var(--space-3) var(--space-6); border: 1px solid var(--border); border-radius: var(--radius-pill); background: transparent; color: var(--primary); font-size: 13px; cursor: pointer; }
.chat-msg { display: flex; align-items: flex-end; gap: var(--space-2); margin-bottom: var(--space-5); }
.chat-msg.user { flex-direction: row-reverse; }
.msg-avatar { display: grid; place-items: center; flex: 0 0 28px; height: 28px; border-radius: var(--radius-pill); background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 650; }
.chat-msg.user .msg-avatar { display: none; }
.chat-msg.consecutive { margin-top: calc(-1 * var(--space-3)); }
.chat-msg.consecutive .msg-avatar { visibility: hidden; }
.msg-bubble { max-width: min(80%,640px); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--surface-muted); color: var(--text); font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.chat-msg.user .msg-bubble { background: var(--primary); color: var(--text-inverse); border-bottom-right-radius: var(--space-1); }
.chat-msg.coach .msg-bubble { border-bottom-left-radius: var(--space-1); }
.msg-bubble ul, .msg-bubble ol { padding-left: var(--space-5); margin: var(--space-2) 0; }
.msg-bubble li { margin: var(--space-1) 0; }
.msg-bubble.streaming:empty::before { content: '小元正在听…'; color: var(--text-secondary); font-size: 13px; }
.msg-bubble.streaming:not(:empty)::after { display: inline-block; width: 3px; height: 14px; margin-left: var(--space-1); background: var(--primary); content: ''; opacity: .5; vertical-align: middle; }
.msg-play { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--primary); cursor: pointer; }
.msg-play .fit-icon { width: 16px; height: 16px; }
.msg-play.speaking { background: var(--primary-soft); }
.chat-retry { display: flex; align-items: center; min-height: 44px; margin-top: var(--space-2); padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-sm); background: var(--surface-card); color: var(--primary); cursor: pointer; }
.chip-bar { display: flex; flex: 0 0 auto; gap: var(--space-2); padding: var(--space-2) var(--space-4); overflow-x: auto; scrollbar-width: thin; }
.chip { display: inline-flex; align-items: center; flex: 0 0 auto; min-height: 44px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-pill); background: var(--performance-soft); color: var(--primary); font-size: 12px; cursor: pointer; }
.chat-input-area { display: flex; align-items: flex-end; flex: 0 0 auto; gap: var(--space-3); padding: var(--space-3) var(--space-4) var(--space-4); background: var(--surface-card); }
.chat-input-wrap { display: flex; flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-elevated); }
.chat-input-wrap textarea { width: 100%; min-height: 48px; max-height: 100px; padding: var(--space-3); border: 0; border-radius: inherit; resize: none; font: inherit; font-size: 16px; line-height: 1.5; color: var(--text); background: transparent; }
.chat-send { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border: 0; border-radius: var(--radius-pill); background: var(--primary); color: var(--text-inverse); cursor: pointer; }
.chat-send:disabled { background: var(--surface-muted); color: var(--text-tertiary); }
.chat-send.loading .fit-icon { animation: skeleton-pulse 1s alternate infinite; }
@media (max-width: 767px) {
  .chat-messages { padding: var(--space-4) var(--space-3); }
  .msg-bubble { max-width: 82%; font-size: 14px; }
  .chat-section { border-radius: var(--radius-md); }
  .chat-input-area { padding: var(--space-3); }
  .chip-bar { padding: var(--space-2) var(--space-3); }
  .chat-empty h3 { font-size: 22px; }
  .chat-empty-prompts { margin-top: var(--space-2); }
  .coach-profile-bar { padding-bottom: var(--space-3); }
  .chat-empty { min-height: min(340px,100%); }
}
.chip-bar[hidden]{display:none}
