// 全局样式文件:src/styles/index.scss // 1. 全局变量(可统一管理颜色、字体、间距等) $primary-color: #2D71FF; // 主色调(和 Element Plus 主色一致) $secondary-color: #667eea; // 辅助色 $text-color: #333333; // 主要文字色 $text-light-color: #666666; // 次要文字色 $border-color: #eeeeee; // 边框色 $bg-color: #f9f9f9; // 背景色 $danger-color: #e63946; // 危险色(价格、警告等) .el-button--primary { &:not(.is-plain) { background-color: $primary-color; border-color: $primary-color; } &.is-plain { // color: $primary-color; border:none; // background-color: #ffffff; } } .container-height { min-height: calc(100vh - 60px); margin-bottom: 140px; } // 2. 全局重置样式(统一浏览器默认样式) * { box-sizing: border-box; font-family: PingFang SC, PingFang SC; } H1, H2, H3, H4, H5, H6, P { margin: 0; } body ,htm{ font-family: "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; color: $text-color; background-color: #f5f5f5; line-height: 1.6; margin: 0; } body{ background: url('@/assets/imgs/bg.png') no-repeat center center fixed; background-size: 100% 100%; } // 3. 公共样式类(全局可复用) // 容器宽度限制(统一页面最大宽度,居中显示) .container { max-width: 1520px; width: 80%; min-width: 1200px; margin: 0 auto; padding: 20px; } .gradient{ background: linear-gradient( 90deg, #0055FE 0%, #C832FA 100%); } // 清除浮动 .clearfix::after { content: ""; display: block; clear: both; } // 禁用选中 .no-select { user-select: none; -webkit-user-select: none; } // 调整折叠面板样式 .el-collapse-item__header { background-color: $bg-color; } // 5. 响应式相关样式(全局通用) // 小屏幕(手机) @media (max-width: 768px) { .container { // padding: 0 10px; } } // 中屏幕(平板) @media (min-width: 769px) and (max-width: 1024px) { .container { // padding: 0 15px; } } @charset "UTF-8"; wx-image{ height: auto; } .padding8 { padding: 8px } .padding12 { padding: 12px } .padding16 { padding: 16px } .padding20 { padding: 20px } .paddingTB20 { padding: 20px 0 } .paddingTB30 { padding: 30px 0 } .paddingTB10 { padding: 10px 0 } .pad20 { padding: 0 20px } .padding15 { padding: 15px } .padding30 { padding: 30px } .pad30 { padding: 0 30px } .pt20 { padding-top: 20px } .pb15 { padding-bottom: 15px } .pb20 { padding-bottom: 20px } .pb30 { padding-bottom: 30px } .mb30 { margin-bottom: 30px; } .mr10 { margin-right: 10px; } .mr20 { margin-right: 20px; } .mr30 { margin-right: 30px; } .mr10 { margin-right: 10px; } .ml5 { margin-left: 5px; } .ml10 { margin-left: 10px; } .ml20 { margin-left: 20px; } .mt2 { margin-top: 2px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mt30 { margin-top: 30px; } .mt16 { margin-top: 16px; } .mt10 { margin-top: 10px; } .mt5 { margin-top: 5px; } .mb20 { margin-bottom: 20px; } .mb10 { margin-bottom: 10px; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap } .line1 { word-break: break-all; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; /* height: 84px; */ } .line2 { word-break: break-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; /* height: 84px; */ } .line3 { word-break: break-all; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; /* height: 84px; */ } .mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: #000; opacity: .5; z-index: 5 } @keyframes load { from { transform: rotate(0) } to { transform: rotate(360deg) } } @-webkit-keyframes load { from { transform: rotate(0) } to { transform: rotate(360deg) } } .loadingpic { animation: load 3s linear 1s infinite; --webkit-animation: load 3s linear 1s infinite } .loading-list { animation: load linear 1s infinite; -webkit-animation: load linear 1s infinite; font-size: 40px; margin-right: 22px } .loading { width: 100%; height: 100px; line-height: 100px; align-items: center; justify-content: center; position: relative; text-align: center } .loading .line { position: absolute; width: 450px; left: 150px; top: 50px; height: 1px; border-top: 1px solid #eee } .loading .text { position: relative; display: inline-block; padding: 0 20px; background: #fff; z-index: 2; color: #777 } .loadingicon .loading { animation: load linear 1s infinite; font-size: 45px; color: #000 } .loadingicon { width: 100%; height: 80px; overflow: hidden } .bg-color-huic{ background: #F1F1F1!important; border: 1px solid #ccc!important; color: #ccc!important; } .nowrap{ white-space: nowrap; } .gap10{ gap: 10px; } /*flex样式*/ .flex_1{ flex:1; } .flex{ display: flex; } .flex_2{ flex: 2; } .flex-between{/*两边对齐*/ display: flex; justify-content: space-between; } .flex-align-center{/*垂直居中*/ display: flex !important; align-items: center; } .flex-center{/*水平垂直居中*/ display: flex; justify-content: center; align-items: center; } .flex-center-flex-end{/*水平垂直居中-尾部对齐*/ display: flex; justify-content: flex-end; align-items: center; } .flex-center-box-end{/*水平垂直居中-铺满盒内*/ display: -webkit-inline-box; justify-content: flex-end; align-items: center; } .flex-center-flex-start{/*水平垂直居中-首部对齐*/ display: flex; justify-content: flex-start; align-items: center; } .flex-center-around{/*水平垂直居中-平均对齐*/ display: flex; justify-content: space-around; align-items: center; } .flex-center-between{/*水平垂直居中-两边对齐*/ display: flex; justify-content: space-between; align-items: center; } .flex-column{/*竖直方向*/ display: flex; flex-direction: column; } .flex-column-center{/*竖直方向水平居中 两端对齐*/ display: flex; flex-direction: column; justify-content: space-between; align-items: center; } .flex-column-start{/*竖直方向水平居中 首部对齐*/ display: flex; flex-direction: column; justify-content: space-around; align-items: self-start; } .flex-column-start-between{/*竖直方向-首部对齐-两端对齐*/ display: flex; flex-direction: column; justify-content: space-between; align-items: self-start; } .flex-column-align{/*竖直方向水平居中*/ display: flex; flex-direction: column; align-items: center; } .flex-center-flex-start-warp{/*水平垂直居中-首部对齐*/ display: flex; justify-content: flex-start; align-items: center; flex-wrap:wrap ; } .gap5{ //水平垂直居中-首部对齐 间隙10px display: flex; justify-content: flex-start; align-items: center; gap: 5px; flex-wrap:wrap ; } .gap10{ //水平垂直居中-首部对齐 间隙10px display: flex; justify-content: flex-start; align-items: center; gap: 10px; flex-wrap:wrap ; } .gap20{ //水平垂直居中-首部对齐 间隙10px display: flex; justify-content: flex-start; align-items: center; gap: 20px; flex-wrap:wrap ; } //课程网格布局 .course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 20px; } .order_btn{ font-size: 25px; color: #ffffff; border-radius:10px; background-color: $primary-color; &.error{ background-color: #E93323; } &.plain{ border:1px solid #cccccc; color: #000000; background-color: #ffffff; } } .border{ border: 1px solid #eeeeee; } .border-bottom{ border-bottom: 1px solid #eeeeee; } .gray{ color: #666666; } .gray999{ color: #999999; } .link{ color: #007aff; } .bg_color_f5{ background-color: #f5f5f5; } .edit_gary { background: #EBEBEB; } .bg_color_fff{ background-color: #ffffff; } .bg_color_primary{ background-color: $primary-color; } .bg_gradient_primary{ background: linear-gradient(180deg, #0089FF 0%, #F5F7FA 50%); background-size: 200% 100vh; background-repeat: no-repeat; } .bg_gradient_primary_toright{ //从左到右渐变色 background: linear-gradient(to right, rgba(73, 171, 255, 1), rgba(0, 137, 255, 1)); } .border_radius_10{ border-radius: 10px; } .border_radius_16{ border-radius: 16px; } .border_radius_20{ border-radius: 20px; } .border_radius_30{ border-radius: 30px; } .bold{ font-weight: bold; } .font_weight400{ font-weight: 400; } .font_size40{ font-size: 40px; } .font_size36{ font-size: 36px; } .font_size35{ font-size: 35px; } .font_size32{ font-size: 32px; } .font_size30{ font-size: 30px; } .font_size28{ font-size: 28px; } .font_size20{ font-size: 20px; } .font_size25{ font-size: 25px; } .font_size24{ font-size: 24px; } .font_size18{ font-size: 18px; } .font_size14{ font-size: 14px; } .font_size13{ font-size: 13px; } .line_height22{ line-height: 22px; } .line_vertical{ width: 6px; height: 24px; background-color: $primary-color; border-radius: 4px; } .color_price{ color: #E43434; } .color_vip{ color: #fee189; } .color_fff{ color: #ffffff; } .color_000{ color: #000000; } .color_theme{ color: $primary-color; } .text_align_center{ text-align: center; } .text_align_right{ text-align: right; } .foot{ padding: 20px 30px; width: 100%; position: fixed; bottom: 0; left: 0; box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1); z-index: 10; } .box_shadow{ box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1); } .ellipsis{ overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .bg_img{ width: 100%; position: absolute; top: 0; left: 0;; z-index: -1; } .line_through{ text-decoration: line-through; } .required{ color: #E93323; } .u_popup_bottom{ border-radius: 30px 30px 0 0; } .overflow_hidden{ overflow: hidden; } .noData{ text-align: center; padding: 30px 0; color: #c8c7cc; }