* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #f5f7fa; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto; height: 100vh; display: flex; flex-direction: column; }
.app { display: flex; flex-direction: column; height: 100%; }
.header { background: white; padding: 8px 12px; border-bottom: 1px solid #e5e5e5; }
.chat-container { flex: 1; overflow-y: auto; padding: 16px; }
.message-list { display: flex; flex-direction: column; gap: 16px; }
.message { max-width: 85%; }
.message.user { align-self: flex-end; }
.message.assistant { align-self: flex-start; }
.role-label { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.content { padding: 10px 14px; border-radius: 18px; background: white; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.message.user .content { background: #3b82f6; color: white; }
.katex-display { overflow-x: auto; }
.input-area { background: white; padding: 12px 16px; border-top: 1px solid #e5e5e5; display: flex; gap: 10px; align-items: flex-end;overflow: visible }
textarea { flex: 1; min-height: 40px; max-height: 120px; padding: 10px 14px; border: 1px solid #e5e5e5; border-radius: 20px; font-size: 15px; font-family: monospace; resize: vertical; }
button { padding: 10px 20px; background: #3b82f6; color: white; border: none; border-radius: 24px; cursor: pointer; }
.formula-suggest { position: fixed; background: white; border: 1px solid #ccc; border-radius: 8px; max-height: 200px; overflow-y: auto; z-index: 1000; }
.suggest-item { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; }
.suggest-item:hover { background: #f0f0f0; }
.dialog { position: fixed; top:0; left:0; right:0; bottom:0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.dialog-content { background: white; border-radius: 12px; width: 90%; max-width: 400px; padding: 20px; }
/* 其他样式省略 */