299 lines
6.4 KiB
CSS
299 lines
6.4 KiB
CSS
@import "tailwindcss";
|
|
@import "tailwindcss/utilities";
|
|
|
|
/* 自定义CSS变量 */
|
|
:root {
|
|
--primary: #4361ee;
|
|
--secondary: #3f37c9;
|
|
--success: #4cc9f0;
|
|
--light: #f8f9fa;
|
|
--dark: #212529;
|
|
--light-blue: #e3f2fd;
|
|
--light-green: #f1f8e9;
|
|
--accent: #ff6b6b;
|
|
--gray: #6c757d;
|
|
|
|
/* 亮色模式变量 */
|
|
--bg-primary: #ffffff;
|
|
--bg-secondary: #f8f9fa;
|
|
--bg-tertiary: #e9ecef;
|
|
--text-primary: #212529;
|
|
--text-secondary: #6c757d;
|
|
--border-color: #e1e5eb;
|
|
--shadow: rgba(0, 0, 0, 0.1);
|
|
--message-bg-sent: linear-gradient(135deg, #4361ee, #3f37c9);
|
|
--message-bg-received: #ffffff;
|
|
--message-text-sent: #ffffff;
|
|
--message-text-received: #212529;
|
|
--input-bg: #ffffff;
|
|
--header-bg: #ffffff;
|
|
|
|
/* 亮色模式背景装饰 */
|
|
--bg-pattern: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" opacity="0.03"><rect width="100" height="100" fill="none"/><circle cx="50" cy="50" r="2" fill="%234361ee"/></svg>');
|
|
--chat-bg: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
|
|
}
|
|
|
|
[data-theme="dark"] {
|
|
/* 暗色模式变量 */
|
|
--bg-primary: #1a1a1a;
|
|
--bg-secondary: #2d2d2d;
|
|
--bg-tertiary: #404040;
|
|
--text-primary: #ffffff;
|
|
--text-secondary: #b0b0b0;
|
|
--border-color: #404040;
|
|
--shadow: rgba(0, 0, 0, 0.3);
|
|
--message-bg-sent: linear-gradient(135deg, #4361ee, #3f37c9);
|
|
--message-bg-received: #2d2d2d;
|
|
--message-text-sent: #ffffff;
|
|
--message-text-received: #ffffff;
|
|
--input-bg: #2d2d2d;
|
|
--header-bg: #2d2d2d;
|
|
|
|
/* 暗色模式背景装饰 */
|
|
--bg-pattern: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" opacity="0.05"><rect width="100" height="100" fill="none"/><path d="M0,0 L100,100 M100,0 L0,100" stroke="%234cc9f0" stroke-width="0.5"/></svg>');
|
|
--chat-bg: linear-gradient(135deg, #111827 0%, #1f2937 100%);
|
|
}
|
|
|
|
/* 全局样式 */
|
|
* {
|
|
font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
|
|
sans-serif;
|
|
}
|
|
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
transition: all 0.3s ease;
|
|
background: var(--bg-primary);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
/* 主应用背景 */
|
|
#app {
|
|
background: var(--chat-bg);
|
|
background-image: var(--bg-pattern);
|
|
background-size: 200px 200px;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
/* 聊天区域背景 */
|
|
.chat-area {
|
|
background: var(--bg-primary);
|
|
background-image: var(--bg-pattern);
|
|
background-size: 150px 150px;
|
|
}
|
|
|
|
/* 消息列表背景 */
|
|
.message-list-background {
|
|
background: var(--bg-secondary);
|
|
background-image: var(--bg-pattern);
|
|
background-size: 100px 100px;
|
|
}
|
|
|
|
/* 滚动条样式 */
|
|
::-webkit-scrollbar {
|
|
width: 6px;
|
|
height: 6px;
|
|
}
|
|
|
|
::-webkit-scrollbar-track {
|
|
background: var(--bg-tertiary);
|
|
border-radius: 3px;
|
|
}
|
|
|
|
::-webkit-scrollbar-thumb {
|
|
background: var(--text-secondary);
|
|
border-radius: 3px;
|
|
}
|
|
|
|
::-webkit-scrollbar-thumb:hover {
|
|
background: var(--primary);
|
|
}
|
|
|
|
/* Ant Design 组件样式覆盖 */
|
|
.ant-input:focus,
|
|
.ant-input-focused {
|
|
border-color: var(--primary) !important;
|
|
box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2) !important;
|
|
}
|
|
|
|
.ant-btn-primary {
|
|
background: var(--primary);
|
|
border-color: var(--primary);
|
|
}
|
|
|
|
.ant-btn-primary:hover {
|
|
background: var(--secondary);
|
|
border-color: var(--secondary);
|
|
}
|
|
|
|
/* 暗色模式下的Ant Design组件样式 */
|
|
[data-theme="dark"] .ant-input {
|
|
background-color: #374151 !important;
|
|
border-color: #4b5563 !important;
|
|
color: #f3f4f6 !important;
|
|
}
|
|
|
|
[data-theme="dark"] .ant-input::placeholder {
|
|
color: #9ca3af !important;
|
|
}
|
|
|
|
[data-theme="dark"] .ant-input:focus,
|
|
[data-theme="dark"] .ant-input-focused {
|
|
background-color: #4b5563 !important;
|
|
border-color: var(--primary) !important;
|
|
}
|
|
|
|
[data-theme="dark"] .ant-textarea {
|
|
background-color: #374151 !important;
|
|
border-color: #4b5563 !important;
|
|
color: #f3f4f6 !important;
|
|
}
|
|
|
|
[data-theme="dark"] .ant-btn {
|
|
background-color: #374151 !important;
|
|
border-color: #4b5563 !important;
|
|
color: #f3f4f6 !important;
|
|
}
|
|
|
|
[data-theme="dark"] .ant-btn:hover {
|
|
background-color: #4b5563 !important;
|
|
border-color: #6b7280 !important;
|
|
}
|
|
|
|
[data-theme="dark"] .ant-dropdown {
|
|
background-color: #374151 !important;
|
|
}
|
|
|
|
[data-theme="dark"] .ant-dropdown .ant-dropdown-menu {
|
|
background-color: #374151 !important;
|
|
border-color: #4b5563 !important;
|
|
}
|
|
|
|
[data-theme="dark"] .ant-dropdown .ant-dropdown-menu-item {
|
|
color: #f3f4f6 !important;
|
|
}
|
|
|
|
[data-theme="dark"] .ant-dropdown .ant-dropdown-menu-item:hover {
|
|
background-color: #4b5563 !important;
|
|
}
|
|
|
|
[data-theme="dark"] .ant-modal {
|
|
background-color: #374151 !important;
|
|
}
|
|
|
|
[data-theme="dark"] .ant-modal-content {
|
|
background-color: #374151 !important;
|
|
}
|
|
|
|
[data-theme="dark"] .ant-modal-header {
|
|
background-color: #374151 !important;
|
|
border-bottom-color: #4b5563 !important;
|
|
}
|
|
|
|
[data-theme="dark"] .ant-modal-title {
|
|
color: #f3f4f6 !important;
|
|
}
|
|
|
|
[data-theme="dark"] .ant-modal-body {
|
|
color: #f3f4f6 !important;
|
|
}
|
|
|
|
/* 动画 */
|
|
@keyframes pulse {
|
|
0% {
|
|
transform: scale(1);
|
|
}
|
|
50% {
|
|
transform: scale(1.05);
|
|
}
|
|
100% {
|
|
transform: scale(1);
|
|
}
|
|
}
|
|
|
|
.animate-pulse {
|
|
animation: pulse 1s infinite;
|
|
}
|
|
|
|
/* 渐变动画 */
|
|
@keyframes gradient-shift {
|
|
0% {
|
|
background-position: 0% 50%;
|
|
}
|
|
50% {
|
|
background-position: 100% 50%;
|
|
}
|
|
100% {
|
|
background-position: 0% 50%;
|
|
}
|
|
}
|
|
|
|
.gradient-animated {
|
|
background-size: 200% 200%;
|
|
animation: gradient-shift 3s ease infinite;
|
|
}
|
|
|
|
/* 响应式设计 */
|
|
@media (max-width: 1024px) {
|
|
.chat-container {
|
|
margin: 0;
|
|
border-radius: 0;
|
|
height: 100vh;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.friend-list {
|
|
width: 280px;
|
|
min-width: 280px;
|
|
}
|
|
|
|
.chat-area {
|
|
min-width: 400px;
|
|
}
|
|
|
|
#app {
|
|
background-size: 150px 150px;
|
|
}
|
|
}
|
|
|
|
/* 自定义组件样式 */
|
|
.custom-input,
|
|
.custom-textarea {
|
|
background: var(--input-bg);
|
|
border-color: var(--border-color);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.custom-input:focus,
|
|
.custom-textarea:focus {
|
|
border-color: var(--primary);
|
|
box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
|
|
}
|
|
|
|
/* 卡片样式 */
|
|
.card {
|
|
background: var(--bg-primary);
|
|
border: 1px solid var(--border-color);
|
|
box-shadow: 0 2px 8px var(--shadow);
|
|
}
|
|
|
|
/* 按钮样式 */
|
|
.btn-primary {
|
|
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
|
color: white;
|
|
border: none;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
|
|
}
|
|
|
|
/* 主题切换动画 */
|
|
* {
|
|
transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
|
|
}
|