You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
383 lines
5.8 KiB
383 lines
5.8 KiB
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 20px;
|
|
}
|
|
|
|
.container {
|
|
width: 100%;
|
|
max-width: 1200px;
|
|
position: relative;
|
|
}
|
|
|
|
.panel {
|
|
background: white;
|
|
border-radius: 16px;
|
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* 连接面板样式 */
|
|
#connectPanel {
|
|
max-width: 450px;
|
|
margin: 0 auto;
|
|
padding: 40px;
|
|
}
|
|
|
|
.logo {
|
|
text-align: center;
|
|
margin-bottom: 40px;
|
|
}
|
|
|
|
.logo h1 {
|
|
font-size: 32px;
|
|
color: #667eea;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.logo p {
|
|
color: #666;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.form-group label {
|
|
display: block;
|
|
margin-bottom: 8px;
|
|
color: #333;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.form-group input {
|
|
width: 100%;
|
|
padding: 12px 16px;
|
|
border: 2px solid #e0e0e0;
|
|
border-radius: 8px;
|
|
font-size: 14px;
|
|
transition: border-color 0.3s;
|
|
}
|
|
|
|
.form-group input:focus {
|
|
outline: none;
|
|
border-color: #667eea;
|
|
}
|
|
|
|
.btn {
|
|
padding: 12px 24px;
|
|
border: none;
|
|
border-radius: 8px;
|
|
font-size: 16px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition: all 0.3s;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: #667eea;
|
|
color: white;
|
|
width: 100%;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background: #5568d3;
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
|
|
}
|
|
|
|
.btn-secondary {
|
|
background: #f44336;
|
|
color: white;
|
|
}
|
|
|
|
.btn-secondary:hover {
|
|
background: #d32f2f;
|
|
}
|
|
|
|
.info-box {
|
|
margin-top: 30px;
|
|
padding: 20px;
|
|
background: #f5f5f5;
|
|
border-radius: 8px;
|
|
}
|
|
|
|
.info-box h3 {
|
|
color: #333;
|
|
margin-bottom: 12px;
|
|
font-size: 16px;
|
|
}
|
|
|
|
.info-box ul {
|
|
list-style: none;
|
|
color: #666;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.info-box li {
|
|
padding: 6px 0;
|
|
padding-left: 20px;
|
|
position: relative;
|
|
}
|
|
|
|
.info-box li:before {
|
|
content: "✓";
|
|
position: absolute;
|
|
left: 0;
|
|
color: #667eea;
|
|
font-weight: bold;
|
|
}
|
|
|
|
/* 聊天面板样式 */
|
|
#chatPanel {
|
|
height: 80vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.chat-header {
|
|
background: #667eea;
|
|
color: white;
|
|
padding: 20px 30px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.header-left h2 {
|
|
font-size: 24px;
|
|
margin-bottom: 5px;
|
|
}
|
|
|
|
.user-info {
|
|
font-size: 14px;
|
|
opacity: 0.9;
|
|
}
|
|
|
|
.header-right {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 15px;
|
|
}
|
|
|
|
.online-count {
|
|
background: rgba(255, 255, 255, 0.2);
|
|
padding: 6px 12px;
|
|
border-radius: 20px;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.chat-body {
|
|
display: flex;
|
|
flex: 1;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.sidebar {
|
|
width: 250px;
|
|
background: #f8f9fa;
|
|
border-right: 1px solid #e0e0e0;
|
|
padding: 20px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.sidebar h3 {
|
|
color: #333;
|
|
margin-bottom: 15px;
|
|
font-size: 16px;
|
|
}
|
|
|
|
.peer-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
}
|
|
|
|
.peer-item {
|
|
padding: 10px 12px;
|
|
background: white;
|
|
border-radius: 8px;
|
|
border: 1px solid #e0e0e0;
|
|
font-size: 14px;
|
|
color: #333;
|
|
}
|
|
|
|
.peer-item:before {
|
|
content: "👤 ";
|
|
}
|
|
|
|
.main-chat {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.message-area {
|
|
flex: 1;
|
|
padding: 20px;
|
|
overflow-y: auto;
|
|
background: #fafafa;
|
|
}
|
|
|
|
.message {
|
|
margin-bottom: 15px;
|
|
animation: slideIn 0.3s ease;
|
|
}
|
|
|
|
@keyframes slideIn {
|
|
from {
|
|
opacity: 0;
|
|
transform: translateY(10px);
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
}
|
|
|
|
.message-system {
|
|
text-align: center;
|
|
color: #999;
|
|
font-size: 13px;
|
|
font-style: italic;
|
|
}
|
|
|
|
.message-user {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
}
|
|
|
|
.message-user.own {
|
|
align-items: flex-end;
|
|
}
|
|
|
|
.message-header {
|
|
font-size: 12px;
|
|
color: #666;
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.message-content {
|
|
max-width: 70%;
|
|
padding: 12px 16px;
|
|
border-radius: 12px;
|
|
word-wrap: break-word;
|
|
font-size: 14px;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.message-user .message-content {
|
|
background: white;
|
|
color: #333;
|
|
border: 1px solid #e0e0e0;
|
|
}
|
|
|
|
.message-user.own .message-content {
|
|
background: #667eea;
|
|
color: white;
|
|
}
|
|
|
|
.input-area {
|
|
display: flex;
|
|
gap: 10px;
|
|
padding: 20px;
|
|
background: white;
|
|
border-top: 1px solid #e0e0e0;
|
|
}
|
|
|
|
.input-area input {
|
|
flex: 1;
|
|
padding: 12px 16px;
|
|
border: 2px solid #e0e0e0;
|
|
border-radius: 8px;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.input-area input:focus {
|
|
outline: none;
|
|
border-color: #667eea;
|
|
}
|
|
|
|
.input-area .btn {
|
|
width: auto;
|
|
min-width: 100px;
|
|
}
|
|
|
|
/* 状态栏 */
|
|
.status-bar {
|
|
position: fixed;
|
|
bottom: 20px;
|
|
right: 20px;
|
|
padding: 12px 20px;
|
|
background: #333;
|
|
color: white;
|
|
border-radius: 8px;
|
|
font-size: 14px;
|
|
opacity: 0;
|
|
transform: translateY(20px);
|
|
transition: all 0.3s;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.status-bar.show {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
|
|
.status-bar.success {
|
|
background: #4caf50;
|
|
}
|
|
|
|
.status-bar.error {
|
|
background: #f44336;
|
|
}
|
|
|
|
/* 响应式设计 */
|
|
@media (max-width: 768px) {
|
|
.chat-body {
|
|
flex-direction: column;
|
|
}
|
|
|
|
.sidebar {
|
|
width: 100%;
|
|
max-height: 150px;
|
|
border-right: none;
|
|
border-bottom: 1px solid #e0e0e0;
|
|
}
|
|
|
|
.message-content {
|
|
max-width: 85%;
|
|
}
|
|
}
|
|
|
|
/* 滚动条样式 */
|
|
::-webkit-scrollbar {
|
|
width: 8px;
|
|
height: 8px;
|
|
}
|
|
|
|
::-webkit-scrollbar-track {
|
|
background: #f1f1f1;
|
|
}
|
|
|
|
::-webkit-scrollbar-thumb {
|
|
background: #888;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
::-webkit-scrollbar-thumb:hover {
|
|
background: #555;
|
|
}
|