Files
SmartChat/static/css/index.css
2026-01-08 01:06:27 +08:00

471 lines
7.8 KiB
CSS

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background-color: #f5f5f5;
color: #333;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
.header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 30px;
border-radius: 15px;
margin-bottom: 30px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
.header h1 {
font-size: 2.5em;
margin-bottom: 10px;
}
.header p {
font-size: 1.1em;
opacity: 0.9;
margin-bottom: 15px;
}
.nav {
display: flex;
gap: 10px;
margin-bottom: 20px;
}
.nav-btn {
padding: 8px 16px;
background: #f8f9fa;
border: 1px solid #ddd;
border-radius: 5px;
text-decoration: none;
color: #333;
transition: all 0.3s;
}
.nav-btn:hover {
background: #667eea;
color: white;
border-color: #667eea;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.stat-card {
background: white;
padding: 25px;
border-radius: 12px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
text-align: center;
transition: transform 0.3s ease;
}
.stat-card:hover {
transform: translateY(-5px);
}
.stat-number {
font-size: 2.5em;
font-weight: bold;
color: #667eea;
margin-bottom: 5px;
}
.stat-label {
color: #666;
font-size: 0.9em;
}
.view-switcher {
display: flex;
gap: 10px;
margin-bottom: 20px;
}
.view-btn {
padding: 10px 20px;
border: 2px solid #667eea;
background: white;
color: #667eea;
border-radius: 25px;
cursor: pointer;
transition: all 0.3s ease;
font-weight: bold;
}
.view-btn.active {
background: #667eea;
color: white;
}
.view-btn:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}
.chat-container {
display: grid;
grid-template-columns: 300px 1fr;
gap: 20px;
height: 70vh;
}
.sidebar {
background: white;
border-radius: 12px;
padding: 20px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
overflow-y: auto;
}
.sidebar h3 {
margin-bottom: 15px;
color: #333;
border-bottom: 2px solid #667eea;
padding-bottom: 10px;
}
.group-list {
list-style: none;
margin-bottom: 20px;
}
.group-item {
padding: 15px;
margin-bottom: 10px;
background: #f8f9fa;
border-radius: 8px;
cursor: pointer;
transition: all 0.3s ease;
border-left: 4px solid transparent;
}
.group-item:hover {
background: #e9ecef;
transform: translateX(5px);
}
.group-item.active {
background: #667eea;
color: white;
border-left-color: #764ba2;
}
.group-name {
font-weight: bold;
margin-bottom: 5px;
}
.group-info {
font-size: 0.8em;
color: #666;
display: flex;
justify-content: space-between;
}
.group-item.active .group-info {
color: rgba(255, 255, 255, 0.8);
}
.chat-area {
background: white;
border-radius: 12px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
display: flex;
flex-direction: column;
}
.chat-header {
padding: 20px;
border-bottom: 1px solid #eee;
background: #f8f9fa;
border-radius: 12px 12px 0 0;
display: flex;
justify-content: space-between;
align-items: center;
}
.current-group {
font-size: 1.2em;
font-weight: bold;
color: #333;
}
.group-stats {
font-size: 0.9em;
color: #666;
}
.controls {
padding: 20px;
border-bottom: 1px solid #eee;
background: #f8f9fa;
border-radius: 0 0 0 0;
text-align: center;
}
.load-more {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: none;
padding: 12px 24px;
border-radius: 25px;
cursor: pointer;
font-size: 1em;
transition: transform 0.3s ease;
}
.load-more:hover {
transform: scale(1.05);
}
.chat-messages {
flex: 1;
overflow-y: auto;
overflow-x: hidden;
padding: 20px;
}
.message {
margin-bottom: 20px;
display: flex;
align-items: flex-start;
}
.message.own {
flex-direction: row-reverse;
}
.avatar {
width: 40px;
height: 40px;
border-radius: 50%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: bold;
margin: 0 10px;
}
.message-content {
max-width: 70%;
padding: 12px 16px;
border-radius: 18px;
background: #f1f3f5;
position: relative;
word-wrap: break-word;
overflow-wrap: break-word;
white-space: normal;
}
.message.own .message-content {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
.message-sender {
font-weight: bold;
margin-bottom: 5px;
font-size: 0.9em;
}
.message-time {
font-size: 0.8em;
color: #999;
margin-top: 5px;
}
.message.own .message-time {
color: rgba(255, 255, 255, 0.8);
}
.loading {
text-align: center;
padding: 20px;
color: #666;
}
.error {
background: #ffe6e6;
color: #d63031;
padding: 10px;
border-radius: 8px;
margin: 10px 0;
text-align: center;
}
@media (max-width: 768px) {
.chat-container {
grid-template-columns: 1fr;
}
.sidebar {
display: none;
}
.message-content {
max-width: 85%;
}
}
body, .container {
overflow-x: hidden;
}
/* 聊天记录按钮样式 */
.chatrecord-btn {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: none;
padding: 8px 16px;
border-radius: 15px;
cursor: pointer;
font-size: 0.9em;
transition: all 0.3s ease;
text-align: left;
max-width: 100%;
word-wrap: break-word;
overflow-wrap: break-word;
white-space: normal;
}
.chatrecord-btn:hover {
transform: scale(1.05);
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}
/* 模态框样式 */
.modal {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
animation: fadeIn 0.3s;
}
.modal-content {
background-color: white;
margin: 5% auto;
padding: 0;
border-radius: 15px;
width: 80%;
max-width: 800px;
max-height: 80vh;
overflow: hidden;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
animation: slideIn 0.3s;
}
.modal-header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 20px;
display: flex;
justify-content: space-between;
align-items: center;
}
.modal-header h3 {
margin: 0;
font-size: 1.3em;
}
.close {
color: white;
font-size: 28px;
font-weight: bold;
cursor: pointer;
transition: opacity 0.3s;
}
.close:hover {
opacity: 0.7;
}
.modal-body {
padding: 0;
max-height: calc(80vh - 80px);
overflow-y: auto;
}
.chat-record-content {
padding: 20px;
}
.chat-record-item {
margin-bottom: 15px;
padding: 15px;
background: #f8f9fa;
border-radius: 10px;
border-left: 4px solid #667eea;
}
.chat-record-sender {
font-weight: bold;
margin-bottom: 5px;
color: #333;
}
.chat-record-text {
margin-bottom: 5px;
line-height: 1.4;
}
.chat-record-time {
font-size: 0.8em;
color: #666;
text-align: right;
}
.chat-record-image {
max-width: 200px;
max-height: 200px;
border-radius: 8px;
margin: 5px 0;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes slideIn {
from {
transform: translateY(-50px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
.container {
max-width: 100%;
overflow-x: hidden;
}