Files
InfoGenie/InfoGenie-frontend/src/styles/global.css
2025-10-15 11:11:23 +08:00

353 lines
5.5 KiB
CSS
Executable File

/* 全局组件样式 */
/* 容器样式 */
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 16px;
}
.mobile-container {
padding: 0 12px;
}
/* 卡片样式 */
.card {
background: rgba(255, 255, 255, 0.95);
border-radius: 16px;
box-shadow: 0 8px 32px rgba(168, 230, 207, 0.3);
overflow: hidden;
transition: all 0.3s ease;
backdrop-filter: blur(10px);
border: 1px solid rgba(168, 230, 207, 0.2);
}
.card:hover {
transform: translateY(-6px);
box-shadow: 0 12px 40px rgba(168, 230, 207, 0.4);
}
.card-header {
padding: 20px;
border-bottom: 1px solid #e5e7eb;
}
.card-body {
padding: 20px;
}
.card-footer {
padding: 16px 20px;
background: #f9fafb;
border-top: 1px solid #e5e7eb;
}
/* 按钮样式 */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 12px 24px;
border-radius: 8px;
font-weight: 500;
font-size: 14px;
transition: all 0.2s ease;
cursor: pointer;
border: none;
text-decoration: none;
min-height: 44px;
}
.btn-primary {
background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
color: white;
}
.btn-primary:hover {
background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
transform: translateY(-1px);
}
.btn-secondary {
background: #f3f4f6;
color: #374151;
}
.btn-secondary:hover {
background: #e5e7eb;
}
.btn-success {
background: #10b981;
color: white;
}
.btn-success:hover {
background: #059669;
}
.btn-danger {
background: #ef4444;
color: white;
}
.btn-danger:hover {
background: #dc2626;
}
.btn-sm {
padding: 8px 16px;
font-size: 12px;
min-height: 36px;
}
.btn-lg {
padding: 16px 32px;
font-size: 16px;
min-height: 52px;
}
.btn-full {
width: 100%;
}
.btn-disabled {
opacity: 0.6;
cursor: not-allowed;
pointer-events: none;
}
/* 输入框样式 */
.input {
width: 100%;
padding: 12px 16px;
border: 2px solid #e5e7eb;
border-radius: 8px;
font-size: 14px;
transition: all 0.2s ease;
min-height: 44px;
}
.input:focus {
border-color: #4ade80;
box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.1);
}
.input-error {
border-color: #ef4444;
}
.input-error:focus {
border-color: #ef4444;
box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}
/* 加载动画 */
.loading {
display: flex;
align-items: center;
justify-content: center;
padding: 40px;
}
.spinner {
width: 40px;
height: 40px;
border: 4px solid #f3f4f6;
border-top: 4px solid #4ade80;
border-radius: 50%;
animation: spin 1s linear infinite;
}
.spinner-sm {
width: 20px;
height: 20px;
border-width: 2px;
}
/* 标签样式 */
.tag {
display: inline-block;
padding: 4px 12px;
background: #f3f4f6;
color: #374151;
border-radius: 16px;
font-size: 12px;
font-weight: 500;
}
.tag-primary {
background: rgba(74, 222, 128, 0.1);
color: #4ade80;
}
.tag-success {
background: rgba(16, 185, 129, 0.1);
color: #10b981;
}
.tag-warning {
background: rgba(245, 158, 11, 0.1);
color: #f59e0b;
}
.tag-danger {
background: rgba(239, 68, 68, 0.1);
color: #ef4444;
}
/* 徽章样式 */
.badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 20px;
height: 20px;
padding: 0 6px;
background: #ef4444;
color: white;
border-radius: 10px;
font-size: 11px;
font-weight: 600;
line-height: 1;
}
/* 分割线 */
.divider {
height: 1px;
background: #e5e7eb;
margin: 16px 0;
}
/* 空状态 */
.empty-state {
text-align: center;
padding: 60px 20px;
color: #6b7280;
}
.empty-state-icon {
font-size: 48px;
margin-bottom: 16px;
opacity: 0.5;
}
.empty-state-title {
font-size: 18px;
font-weight: 600;
margin-bottom: 8px;
color: #374151;
}
.empty-state-description {
font-size: 14px;
line-height: 1.5;
}
/* 错误状态 */
.error-state {
text-align: center;
padding: 40px 20px;
color: #ef4444;
}
.error-state-icon {
font-size: 36px;
margin-bottom: 12px;
}
.error-state-title {
font-size: 16px;
font-weight: 600;
margin-bottom: 8px;
}
.error-state-description {
font-size: 14px;
color: #6b7280;
margin-bottom: 16px;
}
/* 网格布局 */
.grid {
display: grid;
gap: 16px;
}
.grid-1 {
grid-template-columns: 1fr;
}
.grid-2 {
grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
grid-template-columns: repeat(3, 1fr);
}
.grid-4 {
grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 768px) {
.grid-2,
.grid-3,
.grid-4 {
grid-template-columns: 1fr;
}
.mobile-grid-2 {
grid-template-columns: repeat(2, 1fr);
}
}
/* 间距工具 */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
/* 粒子效果样式优化 */
.click-particle {
will-change: transform, opacity;
animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
filter: blur(0.5px);
}
.click-ripple {
will-change: transform, opacity;
animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* 为可点击元素添加更好的视觉反馈 */
button, .btn, a, [role="button"] {
position: relative;
overflow: hidden;
}
/* 优化粒子效果在不同背景下的显示 */
@media (prefers-reduced-motion: reduce) {
.click-particle,
.click-ripple {
animation-duration: 0.3s;
}
}
/* 高性能动画优化 */
.click-particle,
.click-ripple {
transform: translateZ(0);
backface-visibility: hidden;
perspective: 1000px;
}