RichMessageItem.css•5.61 kB
/* Message Container */
.rich-message-item {
padding: 20px;
border-bottom: 1px solid #e5e7eb;
transition: background-color 0.2s;
position: relative;
}
.rich-message-item:hover {
background-color: #fafbfc;
}
/* Header */
.message-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
}
.sender-info {
display: flex;
align-items: center;
gap: 10px;
}
.sender-avatar {
width: 36px;
height: 36px;
border-radius: 50%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
display: flex;
align-items: center;
justify-content: center;
font-weight: 600;
font-size: 16px;
}
.sender-name {
font-weight: 600;
color: #111827;
font-size: 15px;
}
.sender-role {
color: #6b7280;
font-size: 13px;
background: #f3f4f6;
padding: 2px 8px;
border-radius: 12px;
}
.timestamp {
font-size: 13px;
color: #9ca3af;
cursor: help;
}
/* Rich Content */
.rich-content {
color: #374151;
line-height: 1.7;
font-size: 15px;
}
.rich-content > *:first-child {
margin-top: 0;
}
.rich-content > *:last-child {
margin-bottom: 0;
}
/* Headings */
.rich-content h1,
.rich-content h2,
.rich-content h3,
.rich-content h4 {
font-weight: 600;
line-height: 1.3;
margin-top: 24px;
margin-bottom: 12px;
}
.rich-content h1 { font-size: 1.75rem; color: #111827; }
.rich-content h2 { font-size: 1.5rem; color: #1f2937; }
.rich-content h3 { font-size: 1.25rem; color: #374151; }
.rich-content h4 { font-size: 1.1rem; color: #4b5563; }
/* Paragraphs */
.rich-content p {
margin: 12px 0;
}
/* Links */
.rich-link {
color: #2563eb;
text-decoration: none;
font-weight: 500;
border-bottom: 1px solid transparent;
transition: all 0.2s;
}
.rich-link:hover {
color: #1d4ed8;
border-bottom-color: #1d4ed8;
}
/* Mentions */
.mention {
color: #2563eb;
background-color: #dbeafe;
padding: 3px 8px;
border-radius: 16px;
font-weight: 500;
font-size: 14px;
cursor: pointer;
transition: all 0.2s;
}
.mention:hover {
background-color: #bfdbfe;
}
/* Code */
.rich-content code {
background-color: #f3f4f6;
padding: 3px 8px;
border-radius: 4px;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
font-size: 0.875em;
color: #dc2626;
font-weight: 500;
}
/* Code Blocks */
.rich-code-block {
margin: 16px 0;
border-radius: 8px;
overflow: hidden;
background: #f8fafc;
border: 1px solid #e5e7eb;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.code-header {
background: #f1f5f9;
padding: 8px 16px;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #e5e7eb;
}
.code-language {
font-size: 12px;
font-weight: 600;
color: #64748b;
text-transform: uppercase;
}
.copy-btn {
background: white;
border: 1px solid #e2e8f0;
color: #475569;
padding: 4px 12px;
border-radius: 6px;
font-size: 12px;
cursor: pointer;
transition: all 0.2s;
font-weight: 500;
}
.copy-btn:hover {
background: #f8fafc;
border-color: #cbd5e1;
transform: translateY(-1px);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.copy-text::after {
content: "";
}
.rich-code-block pre {
margin: 0;
padding: 16px;
overflow-x: auto;
}
.rich-code-block code {
background: none;
padding: 0;
color: inherit;
font-weight: normal;
}
/* Lists */
.rich-content ul,
.rich-content ol {
margin: 12px 0;
padding-left: 28px;
}
.rich-content li {
margin: 6px 0;
}
/* Task Lists */
.task-item {
list-style: none;
margin-left: -20px;
}
.task-item input[type="checkbox"] {
margin-right: 8px;
transform: scale(1.2);
cursor: pointer;
}
/* Blockquotes */
.rich-quote {
border-left: 4px solid #a78bfa;
padding: 16px 20px;
margin: 16px 0;
background: #f9fafb;
border-radius: 0 8px 8px 0;
color: #4b5563;
font-style: italic;
}
.rich-quote p:first-child {
margin-top: 0;
}
.rich-quote p:last-child {
margin-bottom: 0;
}
/* Tables */
.table-wrapper {
overflow-x: auto;
margin: 16px 0;
border-radius: 8px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.rich-table {
width: 100%;
border-collapse: collapse;
font-size: 14px;
}
.rich-table th,
.rich-table td {
padding: 12px 16px;
text-align: left;
border-bottom: 1px solid #e5e7eb;
}
.rich-table th {
background: #f9fafb;
font-weight: 600;
color: #111827;
border-bottom: 2px solid #e5e7eb;
}
.rich-table tr:hover {
background: #f9fafb;
}
.rich-table tr:last-child td {
border-bottom: none;
}
/* Strong & Emphasis */
.rich-content strong {
font-weight: 600;
color: #111827;
}
.rich-content em {
font-style: italic;
color: #4b5563;
}
/* Horizontal Rule */
.rich-content hr {
border: none;
height: 2px;
background: linear-gradient(to right, transparent, #e5e7eb, transparent);
margin: 24px 0;
}
/* Read Status */
.read-status {
margin-top: 12px;
display: flex;
align-items: center;
gap: 8px;
}
.read-indicator {
font-size: 12px;
color: #10b981;
display: flex;
align-items: center;
gap: 4px;
cursor: help;
opacity: 0.8;
}
/* Animations */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(4px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.rich-message-item {
animation: fadeIn 0.3s ease-out;
}
/* Mobile Adjustments */
@media (max-width: 768px) {
.rich-message-item {
padding: 16px;
}
.sender-avatar {
width: 32px;
height: 32px;
font-size: 14px;
}
.rich-content {
font-size: 14px;
}
.rich-code-block pre {
padding: 12px;
font-size: 13px;
}
}