uni.scss 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. /**
  2. * ============================================================
  3. * 浠艾福 (XAF) Design System — UniApp SCSS Variables
  4. * ============================================================
  5. *
  6. * 色彩体系: 柔和天蓝 + 珊瑚暖色 (信任专业 + 家庭温暖)
  7. * 风格: 极简扁平圆角 (全角色统一)
  8. * Logo配色参考: #6BB9F0 (中蓝) / #D6EAF8 (浅蓝) / ❤白色心形
  9. *
  10. * 设计原则:
  11. * - 扁平圆角:全端统一,无Claymorphism
  12. * - 蓝色为品牌色:传递信任/专业/平静
  13. * - 珊瑚暖色为点缀:保留"家庭温暖"和"关怀"
  14. * - 心形符号:品牌识别元素
  15. * - 减少装饰动效,聚焦内容可读性
  16. *
  17. * v3.0 — 2026-06-06
  18. * ============================================================
  19. */
  20. // ============================================================
  21. // 1. 品牌色彩 (Brand Colors)
  22. // ============================================================
  23. /* 主色调 - 柔和天蓝 (Logo蓝色) */
  24. $uni-primary: #5B9BD5; // Logo中蓝 - 主品牌色
  25. $uni-primary-light: #8FC5E8; // 浅蓝
  26. $uni-primary-dark: #3A7CC4; // 深蓝
  27. $uni-primary-pale: #D6EAF8; // 极浅蓝 (Logo背景色)
  28. /* 辅助暖色 - 珊瑚粉 (家庭温暖) */
  29. $uni-warm: #F08A7A; // 心形暖色 - 保留"关爱"感
  30. $uni-warm-light: #F4B0A5;
  31. $uni-warm-dark: #E06A58;
  32. /* 语义色 (Semantic) */
  33. $uni-success: #4CAF50;
  34. $uni-success-light: #81C784;
  35. $uni-warning: #FFB74D;
  36. $uni-warning-light: #FFD54F;
  37. $uni-error: #EF5350;
  38. $uni-error-light: #E57373;
  39. $uni-info: #5B9BD5; // 复用了品牌蓝
  40. /* 中性色 (Neutral) — 冷调中性,匹配蓝色系 */
  41. $uni-bg-color: #F5F9FC; // 极浅蓝灰背景
  42. $uni-bg-color-grey: #EDF2F7; // 浅灰蓝
  43. $uni-bg-color-dark: #E2E8F0; // 灰蓝
  44. $uni-surface: #FFFFFF; // 卡片/表面
  45. $uni-border-color: #CBD5E1; // 冷灰边框
  46. $uni-border-color-light: #E2E8F0;
  47. $uni-text-color: #1E293B; // 深蓝灰 (正文)
  48. $uni-text-color-secondary: #64748B; // 次要文字
  49. $uni-text-color-grey: #94A3B8; // 灰色文字
  50. $uni-text-color-placeholder: #94A3B8;
  51. $uni-text-color-inverse: #FFFFFF;
  52. // ============================================================
  53. // 2. 字体系统 (Typography)
  54. // ============================================================
  55. /* 字体栈 - 小程序不支持自定义字体 */
  56. $uni-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI',
  57. 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
  58. 'Helvetica Neue', Helvetica, Arial, system-ui, sans-serif;
  59. $uni-font-family-display: $uni-font-family;
  60. $uni-font-family-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  61. /* 字号 */
  62. $uni-font-size-xs: 20rpx;
  63. $uni-font-size-sm: 24rpx;
  64. $uni-font-size-base: 28rpx;
  65. $uni-font-size-lg: 32rpx;
  66. $uni-font-size-xl: 36rpx;
  67. $uni-font-size-2xl: 44rpx;
  68. $uni-font-size-3xl: 52rpx;
  69. /* 字重 */
  70. $uni-font-weight-normal: 400;
  71. $uni-font-weight-medium: 500;
  72. $uni-font-weight-bold: 600;
  73. $uni-font-weight-black: 700;
  74. // ============================================================
  75. // 3. 间距系统 (Spacing)
  76. // ============================================================
  77. $uni-spacing-xs: 8rpx;
  78. $uni-spacing-sm: 16rpx;
  79. $uni-spacing-md: 24rpx;
  80. $uni-spacing-lg: 32rpx;
  81. $uni-spacing-xl: 48rpx;
  82. $uni-spacing-2xl: 64rpx;
  83. $uni-page-padding: 32rpx;
  84. // ============================================================
  85. // 4. 圆角 (Border Radius)
  86. // ============================================================
  87. $uni-radius-sm: 10rpx;
  88. $uni-radius-md: 16rpx;
  89. $uni-radius-lg: 24rpx;
  90. $uni-radius-xl: 32rpx;
  91. $uni-radius-full: 50%;
  92. $uni-radius-round: 9999rpx;
  93. // ============================================================
  94. // 5. 阴影 (Shadows) — 极简风格,轻微阴影
  95. // ============================================================
  96. $uni-shadow-sm: 0 2rpx 8rpx rgba(91, 155, 213, 0.06);
  97. $uni-shadow-md: 0 4rpx 16rpx rgba(91, 155, 213, 0.08);
  98. $uni-shadow-lg: 0 8rpx 32rpx rgba(91, 155, 213, 0.10);
  99. $uni-shadow-inner: inset 0 1rpx 4rpx rgba(0, 0, 0, 0.04);
  100. // ============================================================
  101. // 6. 动画 (Animations) — 节制使用
  102. // ============================================================
  103. $uni-transition-fast: 0.15s ease;
  104. $uni-transition-base: 0.25s ease;
  105. $uni-transition-slow: 0.3s ease;
  106. // ============================================================
  107. // 7. CSS 自定义属性
  108. // ============================================================
  109. :root {
  110. // 品牌色
  111. --color-primary: #5B9BD5;
  112. --color-primary-light: #8FC5E8;
  113. --color-primary-dark: #3A7CC4;
  114. --color-primary-pale: #D6EAF8;
  115. --color-warm: #F08A7A;
  116. --color-warm-light: #F4B0A5;
  117. // 语义色
  118. --color-success: #4CAF50;
  119. --color-warning: #FFB74D;
  120. --color-error: #EF5350;
  121. // 中性色
  122. --bg: #F5F9FC;
  123. --bg-grey: #EDF2F7;
  124. --surface: #FFFFFF;
  125. --text: #1E293B;
  126. --text-secondary: #64748B;
  127. --muted: #94A3B8;
  128. --border: #CBD5E1;
  129. --border-light: #E2E8F0;
  130. // 间距
  131. --space-xs: 4px;
  132. --space-sm: 8px;
  133. --space-md: 12px;
  134. --space-lg: 16px;
  135. --space-xl: 24px;
  136. --space-page: 16px;
  137. // 圆角
  138. --radius-sm: 5px;
  139. --radius-md: 8px;
  140. --radius-lg: 12px;
  141. --radius-xl: 16px;
  142. // 阴影 — 极简风格
  143. --shadow-sm: 0 1px 4px rgba(91, 155, 213, 0.06);
  144. --shadow-md: 0 2px 8px rgba(91, 155, 213, 0.08);
  145. --shadow-lg: 0 4px 16px rgba(91, 155, 213, 0.10);
  146. }
  147. // ============================================================
  148. // 8. 实用工具类
  149. // ============================================================
  150. // --- 文字色彩 ---
  151. .text-primary { color: $uni-primary; }
  152. .text-warm { color: $uni-warm; }
  153. .text-success { color: $uni-success; }
  154. .text-warning { color: $uni-warning; }
  155. .text-error { color: $uni-error; }
  156. .text-muted { color: $uni-text-color-grey; }
  157. .text-secondary { color: $uni-text-color-secondary; }
  158. .text-bold { font-weight: $uni-font-weight-bold; }
  159. .text-black { font-weight: $uni-font-weight-black; }
  160. .text-center { text-align: center; }
  161. .text-sm { font-size: $uni-font-size-sm; }
  162. .text-base { font-size: $uni-font-size-base; }
  163. .text-lg { font-size: $uni-font-size-lg; }
  164. .text-xl { font-size: $uni-font-size-xl; }
  165. .text-2xl { font-size: $uni-font-size-2xl; }
  166. .text-3xl { font-size: $uni-font-size-3xl; }
  167. // --- 背景 ---
  168. .bg-primary { background-color: $uni-primary; }
  169. .bg-warm { background-color: $uni-warm; }
  170. .bg-surface { background-color: $uni-surface; }
  171. .bg-page { background-color: $uni-bg-color; }
  172. // --- 圆角 ---
  173. .radius-sm { border-radius: $uni-radius-sm; }
  174. .radius-md { border-radius: $uni-radius-md; }
  175. .radius-lg { border-radius: $uni-radius-lg; }
  176. .radius-xl { border-radius: $uni-radius-xl; }
  177. // --- 弹性布局 ---
  178. .flex { display: flex; }
  179. .flex-col { flex-direction: column; }
  180. .flex-row { flex-direction: row; }
  181. .flex-wrap { flex-wrap: wrap; }
  182. .flex-1 { flex: 1; }
  183. .items-center { align-items: center; }
  184. .justify-center { justify-content: center; }
  185. .justify-between { justify-content: space-between; }
  186. .justify-around { justify-content: space-around; }
  187. .gap-xs { gap: $uni-spacing-xs; }
  188. .gap-sm { gap: $uni-spacing-sm; }
  189. .gap-md { gap: $uni-spacing-md; }
  190. .gap-lg { gap: $uni-spacing-lg; }
  191. // --- 间距 ---
  192. .m-0 { margin: 0; }
  193. .p-0 { padding: 0; }
  194. .p-sm { padding: $uni-spacing-sm; }
  195. .p-md { padding: $uni-spacing-md; }
  196. .p-lg { padding: $uni-spacing-lg; }
  197. .mt-sm { margin-top: $uni-spacing-sm; }
  198. .mt-md { margin-top: $uni-spacing-md; }
  199. .mt-lg { margin-top: $uni-spacing-lg; }
  200. .mb-sm { margin-bottom: $uni-spacing-sm; }
  201. .mb-md { margin-bottom: $uni-spacing-md; }
  202. .mb-lg { margin-bottom: $uni-spacing-lg; }
  203. // --- 其他 ---
  204. .w-full { width: 100%; }
  205. .h-full { height: 100%; }
  206. .relative { position: relative; }
  207. .overflow-hidden { overflow: hidden; }
  208. .truncate {
  209. overflow: hidden;
  210. text-overflow: ellipsis;
  211. white-space: nowrap;
  212. }
  213. // ============================================================
  214. // 9. 扁平圆角卡片 (Flat Rounded Card) — 全端统一风格
  215. // ============================================================
  216. @mixin flat-card($border-color: $uni-border-color-light) {
  217. border-radius: $uni-radius-md;
  218. background: $uni-surface;
  219. border: 1rpx solid $border-color;
  220. box-shadow: $uni-shadow-sm;
  221. }
  222. @mixin flat-button($bg-color: $uni-primary) {
  223. border-radius: $uni-radius-lg;
  224. background: $bg-color;
  225. color: #FFFFFF;
  226. border: none;
  227. transition: opacity $uni-transition-fast;
  228. &:active {
  229. opacity: 0.85;
  230. }
  231. }
  232. .flat-card {
  233. @include flat-card;
  234. }
  235. // ============================================================
  236. // 10. 关键帧动画(精简)
  237. // ============================================================
  238. @keyframes fadeIn {
  239. from { opacity: 0; }
  240. to { opacity: 1; }
  241. }
  242. @keyframes slideUp {
  243. from { opacity: 0; transform: translateY(20rpx); }
  244. to { opacity: 1; transform: translateY(0); }
  245. }
  246. @keyframes scaleIn {
  247. from { opacity: 0; transform: scale(0.95); }
  248. to { opacity: 1; transform: scale(1); }
  249. }
  250. @keyframes pulseSoft {
  251. 0%, 100% { opacity: 1; }
  252. 50% { opacity: 0.7; }
  253. }
  254. // 动画实用类
  255. .animate-fade-in { animation: fadeIn $uni-transition-base both; }
  256. .animate-slide-up { animation: slideUp $uni-transition-slow both; }
  257. .animate-scale-in { animation: scaleIn $uni-transition-slow both; }
  258. .animate-pulse-soft { animation: pulseSoft 3s ease-in-out infinite; }
  259. // 交错入场
  260. @for $i from 1 through 20 {
  261. .animate-stagger-#{$i} {
  262. animation-delay: #{$i * 60}ms;
  263. }
  264. }
  265. // ============================================================
  266. // 11. 骨架屏
  267. // ============================================================
  268. @mixin skeleton {
  269. background: linear-gradient(
  270. 90deg,
  271. $uni-border-color-light 25%,
  272. #F5F9FC 50%,
  273. $uni-border-color-light 75%
  274. );
  275. background-size: 200% 100%;
  276. animation: shimmer 1.5s ease-in-out infinite;
  277. border-radius: $uni-radius-sm;
  278. }
  279. @keyframes shimmer {
  280. 0% { background-position: -200% 0; }
  281. 100% { background-position: 200% 0; }
  282. }
  283. .skeleton { @include skeleton; }
  284. .skeleton-text {
  285. @include skeleton;
  286. height: 28rpx;
  287. margin-bottom: 12rpx;
  288. }
  289. .skeleton-block {
  290. @include skeleton;
  291. height: 160rpx;
  292. }