|
143 | 143 | .chd-bubble__ack{font-variant-numeric:tabular-nums} |
144 | 144 | } |
145 | 145 |
|
| 146 | +.course-tool-chat { |
| 147 | + /* ---------- Buttons ---------- */ |
| 148 | + .btn{ |
| 149 | + border-radius: 12px; |
| 150 | + padding: 8px 12px; |
| 151 | + font-size: 14px; |
| 152 | + font-weight: 600; |
| 153 | + border: 1px solid #E5E7EB; |
| 154 | + background:#fff; |
| 155 | + color:#374151; |
| 156 | + cursor: pointer; |
| 157 | + transition: background .15s ease, box-shadow .15s ease, border-color .15s ease, color .15s ease; |
| 158 | + } |
| 159 | + .btn:hover{ background:#F9FAFB; } |
| 160 | + .btn:disabled{ opacity:.5; cursor:not-allowed; } |
| 161 | + .btn-primary{ background:#4F46E5; border-color:#4F46E5; color:#fff; box-shadow: 0 2px 6px rgba(79,70,229,.25); } |
| 162 | + .btn-primary:hover{ background:#4338CA; } |
| 163 | + .btn-secondary{ color:#374151; } |
| 164 | + .btn-tertiary{ background:#fff; color:#4B5563; } |
| 165 | + .btn-danger-outline{ border-color:#EF4444; color:#B91C1C; background:#fff; } |
| 166 | + .btn-danger-outline:hover{ background:#FEE2E2; } |
| 167 | + |
| 168 | + /* ---------- Textarea feel ---------- */ |
| 169 | + .chat-writer{ |
| 170 | + line-height: 1.35; |
| 171 | + white-space: pre-wrap; |
| 172 | + word-break: break-word; |
| 173 | + tab-size: 2; |
| 174 | + letter-spacing: normal; |
| 175 | + resize: vertical; |
| 176 | + } |
| 177 | + |
| 178 | + /* ---------- Chat history container ---------- */ |
| 179 | + .chat-history{ |
| 180 | + background:#FAFAFA; |
| 181 | + border:1px solid #F3F4F6; |
| 182 | + border-radius: 16px; |
| 183 | + padding: 12px; |
| 184 | + min-height: 220px; |
| 185 | + max-height: 50vh; |
| 186 | + overflow-y: auto; |
| 187 | + } |
| 188 | + |
| 189 | + /* ---------- Bubbles (match backend HTML structure) ---------- */ |
| 190 | + .message-teacher, |
| 191 | + .message-student{ |
| 192 | + display:flex; |
| 193 | + align-items:flex-end; |
| 194 | + gap:10px; |
| 195 | + margin:10px 0; |
| 196 | + } |
| 197 | + .message-teacher{ justify-content:flex-end; } |
| 198 | + .message-student{ justify-content:flex-start; } |
| 199 | + |
| 200 | + .message-teacher .content-message, |
| 201 | + .message-student .content-message{ |
| 202 | + max-width: 72%; |
| 203 | + padding: 10px 12px; |
| 204 | + border-radius: 14px; |
| 205 | + box-shadow: 0 1px 2px rgba(0,0,0,.04); |
| 206 | + } |
| 207 | + |
| 208 | + .message-teacher .content-message{ |
| 209 | + background:#4F46E5; color:#fff; |
| 210 | + border-top-right-radius: 4px; |
| 211 | + } |
| 212 | + .message-student .content-message{ |
| 213 | + background:#F3F4F6; color:#111827; |
| 214 | + border-top-left-radius: 4px; |
| 215 | + } |
| 216 | + |
| 217 | + .chat-image{ |
| 218 | + width: 36px; height: 36px; border-radius: 9999px; object-fit: cover; |
| 219 | + border: 1px solid #E5E7EB; |
| 220 | + } |
| 221 | + .chat-message-block-name{ |
| 222 | + font-weight: 600; font-size: 0.85rem; margin-bottom: 2px; |
| 223 | + color: currentColor; |
| 224 | + } |
| 225 | + .chat-message-block-content p{ margin: 0; } |
| 226 | + .chat-message-block-content p + p{ margin-top: .25rem; } |
| 227 | + .chat-message-block-content h1, |
| 228 | + .chat-message-block-content h2, |
| 229 | + .chat-message-block-content h3, |
| 230 | + .chat-message-block-content h4, |
| 231 | + .chat-message-block-content h5, |
| 232 | + .chat-message-block-content h6{ margin: .25rem 0; font-size: 1em; } |
| 233 | + .chat-message-block-content ul, |
| 234 | + .chat-message-block-content ol{ margin: .25rem 0; padding-left: 1.25rem; } |
| 235 | + .chat-message-block-content blockquote{ margin: .25rem 0; padding-left: .75rem; border-left: 3px solid #E5E7EB; color:#6B7280; } |
| 236 | + |
| 237 | + .message-date{ |
| 238 | + font-size: .7rem; opacity:.8; margin-top: 6px; text-align: right; |
| 239 | + color: #E0E7FF; /* light for teacher bubble */ |
| 240 | + } |
| 241 | + .message-student .message-date{ color:#6B7280; text-align:left; } |
| 242 | + |
| 243 | + /* Emoji popover */ |
| 244 | + #emoji-popover.emoji-popover{ |
| 245 | + position: fixed; |
| 246 | + z-index: 50; |
| 247 | + width: max-content; |
| 248 | + max-width: calc(100vw - 24px); |
| 249 | + max-height: 18rem; |
| 250 | + overflow: auto; |
| 251 | + padding: 8px; |
| 252 | + border: 1px solid #E5E7EB; |
| 253 | + border-radius: 16px; |
| 254 | + background: #fff; |
| 255 | + box-shadow: 0 10px 20px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.06); |
| 256 | + } |
| 257 | + #emoji-popover .emoji-btn{ |
| 258 | + width: 2.4rem; height: 2.4rem; font-size: 1.25rem; line-height: 1; |
| 259 | + display: flex; align-items: center; justify-content: center; |
| 260 | + border-radius: 10px; border: none; background: transparent; cursor: pointer; |
| 261 | + } |
| 262 | + #emoji-popover .emoji-btn:hover{ background:#F3F4F6; } |
| 263 | + #emoji-popover .emoji-btn:focus{ outline:2px solid rgba(79,70,229,.6); outline-offset:2px; } |
| 264 | + |
| 265 | + /* Emoji-friendly font stack */ |
| 266 | + #chat-writer, .chat-history, #emoji-popover{ |
| 267 | + font-family: Arial,sans-serif, "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue"; |
| 268 | + } |
| 269 | +} |
| 270 | + |
146 | 271 | @media (max-width: 720px) { |
147 | 272 | .chd .chd-dock { width: 100%; right: 0; left: 0; bottom: 0; border-radius: 10px; } |
148 | 273 | .chd .chd-body { grid-template-columns: 1fr; } |
|
0 commit comments