Files
HAOVP/frontend/video-frontend-web/src/styles/index.scss
T

419 lines
7.7 KiB
SCSS

// 全局样式入口
// 重置样式
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,
body {
width: 100%;
min-height: 100vh;
font-family: 'Microsoft YaHei', 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
font-size: 14px;
line-height: 1.5;
color: #18191c;
background-color: #f4f5f7;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
body {
min-width: 320px;
}
a {
color: inherit;
text-decoration: none;
}
ul,
ol {
list-style: none;
}
img {
max-width: 100%;
height: auto;
}
button {
border: none;
background: none;
cursor: pointer;
font-family: inherit;
}
input,
textarea,
select {
font-family: inherit;
font-size: inherit;
}
// 滚动条样式
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 4px;
}
::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 4px;
&:hover {
background: #a8a8a8;
}
}
// NProgress 样式覆盖
#nprogress {
.bar {
background: linear-gradient(to right, #00a1d6, #fb7299) !important;
height: 3px !important;
}
.peg {
box-shadow: 0 0 10px #00a1d6, 0 0 5px #00a1d6 !important;
}
}
// 主题变量
:root {
--primary-color: #fb7299;
--primary-hover-color: #ff85ad;
--link-color: #00a1d6;
--link-hover-color: #33b4de;
--success-color: #52c41a;
--warning-color: #faad14;
--error-color: #ff4d4f;
--info-color: #1890ff;
--pink-color: #fb7299;
--pink-hover-color: #ff85ad;
--text-primary: #18191c;
--text-secondary: #61666d;
--text-tertiary: #9499a0;
--text-white: #fff;
--bg-primary: #f4f5f7;
--bg-secondary: #fff;
--bg-tertiary: #f6f7f8;
--bg-soft-blue: #edf7ff;
--bg-soft-pink: #fff2f6;
--border-color: #e3e5e7;
--border-light: #f1f2f3;
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
--shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
--shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.08);
--radius-sm: 6px;
--radius-md: 10px;
--radius-lg: 16px;
--spacing-xs: 4px;
--spacing-sm: 8px;
--spacing-md: 16px;
--spacing-lg: 24px;
--spacing-xl: 32px;
--header-top-height: 42px;
--header-main-height: 74px;
--header-height: 74px;
--header-total-height: 116px;
--home-banner-height: 190px;
--sidebar-width: 200px;
--max-content-width: 1380px;
}
@media (max-width: 768px) {
:root {
--header-main-height: 56px;
--header-height: 56px;
--header-total-height: 56px;
--home-banner-height: 132px;
}
}
// 暗色主题
.dark {
--text-primary: #e5e5e5;
--text-secondary: #a0a0a0;
--text-tertiary: #666;
--bg-primary: #1a1a1a;
--bg-secondary: #252525;
--bg-tertiary: #2a2a2a;
--border-color: #333;
--border-light: #2a2a2a;
}
// 常用类
.text-ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.text-ellipsis-2 {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.text-ellipsis-3 {
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.flex-center {
display: flex;
align-items: center;
justify-content: center;
}
.flex-between {
display: flex;
align-items: center;
justify-content: space-between;
}
.flex-column {
display: flex;
flex-direction: column;
}
.page-container {
max-width: var(--max-content-width);
margin: 0 auto;
padding: var(--spacing-md);
}
.card {
background: var(--bg-secondary);
border-radius: var(--radius-md);
box-shadow: var(--shadow-sm);
}
.page-shell {
width: min(var(--max-content-width), calc(100% - 24px));
margin: 0 auto;
}
// Vant feedback layer overrides
:root {
--van-dialog-width: 420px;
--van-dialog-radius: 20px;
--van-dialog-background: rgba(255, 255, 255, 0.98);
--van-dialog-has-title-message-text-color: #61666d;
--van-dialog-message-font-size: 14px;
--van-dialog-confirm-button-text-color: #fb7299;
--van-dialog-cancel-button-text-color: #61666d;
--van-toast-radius: 18px;
--van-toast-default-width: auto;
--van-toast-background: rgba(24, 25, 28, 0.92);
--van-toast-text-color: #fff;
--van-notify-radius: 0 0 18px 18px;
}
.van-overlay {
backdrop-filter: blur(4px);
}
.van-dialog {
border-radius: 20px !important;
overflow: hidden;
box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18);
.van-dialog__header {
padding: 22px 24px 6px;
font-size: 20px;
font-weight: 700;
color: #18191c;
text-align: left;
}
.van-dialog__message {
padding: 0 24px 18px;
line-height: 1.7;
text-align: left;
}
.van-dialog__footer {
padding: 0 16px 16px;
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12px;
&::after {
display: none;
}
}
.van-dialog__confirm,
.van-dialog__cancel {
height: 42px;
margin: 0;
border-radius: 14px;
border: 1px solid #e9edf2;
font-size: 15px;
font-weight: 600;
}
.van-dialog__cancel {
background: #f6f7f8;
}
.van-dialog__confirm {
background: #fff2f6;
border-color: #ffd5e2;
}
}
.van-toast {
min-width: 144px;
max-width: min(320px, calc(100vw - 32px));
padding: 14px 18px;
border-radius: 20px !important;
border: 1px solid rgba(255, 255, 255, 0.14);
backdrop-filter: blur(14px);
box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
font-size: 14px;
line-height: 1.5;
text-align: center;
transform: translateY(0);
animation: toast-pop-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
will-change: transform, opacity;
.van-toast__text {
font-weight: 600;
letter-spacing: 0.01em;
}
.van-toast__icon {
margin-bottom: 10px;
font-size: 24px;
}
}
.van-toast--text {
background:
linear-gradient(180deg, rgba(35, 39, 47, 0.96), rgba(24, 25, 28, 0.92)),
rgba(24, 25, 28, 0.92);
}
.van-toast--success {
background:
linear-gradient(135deg, rgba(240, 253, 244, 0.96), rgba(220, 252, 231, 0.94)),
#f0fdf4;
border-color: rgba(34, 197, 94, 0.18);
color: #166534 !important;
box-shadow: 0 18px 42px rgba(34, 197, 94, 0.18);
.van-toast__icon {
color: #22c55e;
}
}
.van-toast--fail {
background:
linear-gradient(135deg, rgba(254, 242, 242, 0.96), rgba(255, 228, 230, 0.94)),
#fff1f2;
border-color: rgba(244, 63, 94, 0.16);
color: #be123c !important;
box-shadow: 0 18px 42px rgba(244, 63, 94, 0.16);
.van-toast__icon {
color: #f43f5e;
}
}
.van-toast--loading {
background:
linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(224, 242, 254, 0.94)),
#eff6ff;
border-color: rgba(14, 165, 233, 0.18);
color: #0f766e !important;
box-shadow: 0 18px 42px rgba(14, 165, 233, 0.16);
}
@keyframes toast-pop-in {
0% {
opacity: 0;
transform: translateY(8px) scale(0.96);
}
100% {
opacity: 1;
transform: translateY(0) scale(1);
}
}
@media (prefers-reduced-motion: reduce) {
.van-toast {
animation: none;
}
}
.van-notify {
box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}
// 骨架屏动画
.skeleton {
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
background-size: 200% 100%;
animation: skeleton-loading 1.5s infinite;
}
@keyframes skeleton-loading {
0% {
background-position: 200% 0;
}
100% {
background-position: -200% 0;
}
}
// 淡入动画
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.3s ease;
}
.fade-enter-from,
.fade-leave-to {
opacity: 0;
}
// 滑入动画
.slide-enter-active,
.slide-leave-active {
transition: transform 0.3s ease;
}
.slide-enter-from,
.slide-leave-to {
transform: translateX(100%);
}
// 缩放动画
.scale-enter-active,
.scale-leave-active {
transition: transform 0.3s ease, opacity 0.3s ease;
}
.scale-enter-from,
.scale-leave-to {
transform: scale(0.9);
opacity: 0;
}