variables.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. // ===== 建科小智全局样式变量 v3.2 =====
  2. // 项目:jk-rag-platform
  3. // 更新:2026-03-24
  4. // 说明:更新为企业品牌色彩系统(基于 favicon #005D80)
  5. // ==================== 主题变量 ====================
  6. :root {
  7. --sidebar-bg: #ffffff;
  8. --header-bg: #ffffff;
  9. --header-text-color: #374151;
  10. }
  11. html[data-theme='dark'] {
  12. --sidebar-bg: #1f2d3d;
  13. --header-bg: #1f2d3d;
  14. --header-text-color: #ffffff;
  15. }
  16. html[data-theme='light'] {
  17. --sidebar-bg: #ffffff;
  18. --header-bg: #ffffff;
  19. --header-text-color: #374151;
  20. }
  21. // Less 变量别名
  22. $sidebar-bg: var(--sidebar-bg);
  23. $header-bg: var(--header-bg);
  24. $header-text-color: var(--header-text-color);
  25. // 按钮选中/强调色
  26. html[data-theme='dark'] {
  27. --btn-selected-bg: #005D80;
  28. --btn-selected-color: #fff;
  29. }
  30. html[data-theme='light'] {
  31. --btn-selected-bg: #005D80;
  32. --btn-selected-color: #fff;
  33. }
  34. $btn-selected-bg: var(--btn-selected-bg);
  35. $btn-selected-color: var(--btn-selected-color);
  36. // ===== 色彩系统(v3.2 更新为企业品牌色)=====
  37. // 主色调 - 企业蓝色系(基于 favicon #005D80)
  38. // 对比度测试:#005D80 on #FFFFFF = 8.02:1 ✅ WCAG AAA
  39. $primary-color: #005D80; // 企业主色(深度蓝)
  40. $primary-light: #007A99; // 提亮 20%(悬停/强调),对比度 6.5:1 ✅
  41. $primary-dark: #004060; // 加深 20%(点击/激活),对比度 10.2:1 ✅
  42. $primary-lightest: #E6F7FA; // 最浅色(背景点缀)
  43. // 主色渐变(仅用于大图形/按钮背景)
  44. $primary-gradient-start: #00A0CA; // 渐变起点(亮蓝)
  45. $primary-gradient-end: #005D80; // 渐变终点(深蓝)
  46. // 辅助色 - 基于企业绿色系 + 功能性颜色
  47. // 成功色:使用加深绿,确保对比度安全
  48. $success-color: #059669; // 成功色(加深),对比度 4.6:1 ✅ WCAG AA
  49. $success-light: #10B981; // 成功浅色(仅大图标/背景)
  50. $success-dark: #047857; // 成功深色(强调)
  51. // 警告色:橙色系
  52. $warning-color: #F59E0B; // 警告色,对比度 2.9:1 ⚠️ 仅大图形
  53. $warning-light: #FBBF24; // 警告浅色
  54. $warning-dark: #B45309; // 警告深色(文字用),对比度 5.8:1 ✅
  55. // 错误色:红色系
  56. $error-color: #DC2626; // 错误色(加深),对比度 4.5:1 ✅ WCAG AA
  57. $error-light: #EF4444; // 错误浅色
  58. $error-dark: #B91C1C; // 错误深色
  59. // 信息色:企业青色
  60. $info-color: #00A0C7; // 信息色(企业青),对比度 3.8:1 ⚠️ 大图形
  61. $info-light: #06B6D4; // 信息浅色
  62. $info-dark: #0E7490; // 信息深色(文字用)
  63. // Chat 专用色(universalChat 使用)
  64. $chat-primary-start: #00A0C7; // Chat 渐变起点(青)
  65. $chat-primary-end: #08A84C; // Chat 渐变终点(绿)
  66. $chat-accent: #059669; // Chat 强调色(加深绿,文字可用)
  67. // 中性色 - 文字
  68. $text-primary: #1F2937;
  69. $text-secondary: #6B7280;
  70. $text-hint: #9CA3AF;
  71. $text-disabled: #D1D5DB;
  72. // 中性色 - 背景
  73. $bg-primary: #F9FAFB;
  74. $bg-secondary: #FFFFFF;
  75. $bg-tertiary: #F3F4F6;
  76. $bg-hover: #F9FAFB;
  77. $bg-active: rgba(0, 93, 128, 0.1); // 使用新主色的 10% 透明度
  78. // 中性色 - 边框
  79. $border-light: #F3F4F6;
  80. $border-base: #E5E7EB;
  81. $border-dark: #D1D5DB;
  82. // ===== 间距系统(4px 基准)=====
  83. $spacing-1: 4px;
  84. $spacing-2: 8px;
  85. $spacing-3: 12px;
  86. $spacing-4: 16px;
  87. $spacing-5: 20px;
  88. $spacing-6: 24px;
  89. $spacing-7: 28px;
  90. $spacing-8: 32px;
  91. $spacing-9: 36px;
  92. $spacing-10: 40px;
  93. $spacing-12: 48px;
  94. $spacing-16: 64px;
  95. // 快捷别名
  96. $spacing-xs: $spacing-1;
  97. $spacing-sm: $spacing-2;
  98. $spacing-md: $spacing-3;
  99. $spacing-lg: $spacing-4;
  100. $spacing-xl: $spacing-6;
  101. $spacing-2xl: $spacing-8;
  102. // ===== 圆角系统 =====
  103. $radius-sm: 4px;
  104. $radius-md: 6px;
  105. $radius-lg: 8px;
  106. $radius-xl: 12px;
  107. $radius-2xl: 16px;
  108. $radius-full: 9999px;
  109. // 快捷别名
  110. $border-radius-sm: $radius-sm;
  111. $border-radius-md: $radius-md;
  112. $border-radius-lg: $radius-lg;
  113. $border-radius-xl: $radius-xl;
  114. $border-radius-2xl: $radius-2xl;
  115. $border-radius-full: $radius-full;
  116. // ===== 阴影系统 =====
  117. $shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  118. $shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  119. $shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  120. $shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
  121. $shadow-glow: 0 0 20px rgba(0, 93, 128, 0.3); // 使用新主色的发光效果
  122. $shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  123. // ===== 字体系统 =====
  124. // 字体大小(整体缩小一号)
  125. $font-xs: 8px; // 9px → 8px
  126. $font-sm: 11px; // 12px → 11px
  127. $font-base: 12px; // 13px → 12px
  128. $font-md: 13px; // 14px → 13px
  129. $font-lg: 14px; // 15px → 14px
  130. $font-xl: 15px; // 16px → 15px
  131. $font-2xl: 16px; // 18px → 16px
  132. $font-3xl: 18px; // 20px → 18px
  133. $font-4xl: 20px; // 24px → 20px
  134. // 字重
  135. $font-weight-normal: 400;
  136. $font-weight-medium: 500;
  137. $font-weight-semibold: 600;
  138. $font-weight-bold: 700;
  139. // 行高(更紧凑)
  140. $line-height-tight: 1.1; // 1.2 → 1.1
  141. $line-height-base: 1.3; // 1.4 → 1.3
  142. $line-height-relaxed: 1.4; // 1.5 → 1.4
  143. $line-height-loose: 1.5; // 1.6 → 1.5
  144. // 字体家族
  145. $font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  146. $font-family-mono: 'Monaco', 'Consolas', 'Courier New', monospace;
  147. // ===== 动画系统 =====
  148. // 时长
  149. $animation-fast: 0.1s;
  150. $animation-base: 0.2s;
  151. $animation-slow: 0.3s;
  152. // 缓动函数
  153. $easing-default: cubic-bezier(0.4, 0, 0.2, 1);
  154. $easing-in: cubic-bezier(0.4, 0, 1, 1);
  155. $easing-out: cubic-bezier(0, 0, 0.2, 1);
  156. $easing-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  157. // 快捷过渡
  158. $transition-base: all $animation-base $easing-default;
  159. $transition-fast: all $animation-fast $easing-default;
  160. $transition-slow: all $animation-slow $easing-default;
  161. // ===== 响应式断点 =====
  162. $screen-sm: 640px;
  163. $screen-md: 768px;
  164. $screen-lg: 1024px;
  165. $screen-xl: 1280px;
  166. $screen-2xl: 1536px;
  167. // 断点别名(max-width)
  168. $breakpoint-xs: "only screen and (max-width: #{$screen-sm})";
  169. $breakpoint-sm: "only screen and (max-width: #{$screen-md})";
  170. $breakpoint-md: "only screen and (max-width: #{$screen-lg})";
  171. $breakpoint-lg: "only screen and (max-width: #{$screen-xl})";
  172. $breakpoint-xl: "only screen and (max-width: #{$screen-2xl})";
  173. // 断点别名(min-width)
  174. $breakpoint-sm-up: "only screen and (min-width: #{$screen-sm})";
  175. $breakpoint-md-up: "only screen and (min-width: #{$screen-md})";
  176. $breakpoint-lg-up: "only screen and (min-width: #{$screen-lg})";
  177. $breakpoint-xl-up: "only screen and (min-width: #{$screen-xl})";
  178. $breakpoint-2xl-up: "only screen and (min-width: #{$screen-2xl})";
  179. // ===== 布局尺寸 =====
  180. $header-height: 64px;
  181. $sidebar-width: 240px; // 紧凑布局:256px → 240px
  182. $sidebar-collapsed-width: 80px;
  183. $sidebar-width-md: 200px; // 中等屏幕(≤1024px)
  184. $logo-size: 40px;
  185. $search-height: 40px;
  186. $breadcrumb-height: 44px;
  187. // 卡片尺寸
  188. $card-padding: $spacing-4; // 16px
  189. $card-radius: $radius-xl; // 12px
  190. $card-icon-size: 48px;
  191. $card-btn-size: 28px;
  192. $card-play-btn-size: 36px;
  193. // ===== Z-Index 层级 =====
  194. $z-index-base: 1;
  195. $z-index-dropdown: 100;
  196. $z-index-sticky: 200;
  197. $z-index-fixed: 300;
  198. $z-index-modal-backdrop: 400;
  199. $z-index-modal: 500;
  200. $z-index-popover: 600;
  201. $z-index-tooltip: 700;
  202. $z-index-notification: 800;
  203. $z-index-max: 9999;
  204. // ===== 透明度 =====
  205. $opacity-disabled: 0.5;
  206. $opacity-disabled-light: 0.3;
  207. $opacity-overlay: 0.5;
  208. $opacity-hover: 0.9;
  209. $opacity-active: 0.8;
  210. // ===== 图标尺寸 =====
  211. $icon-xs: 12px;
  212. $icon-sm: 14px;
  213. $icon-md: 16px;
  214. $icon-lg: 18px;
  215. $icon-xl: 20px;
  216. $icon-2xl: 24px;
  217. $icon-3xl: 32px;
  218. // ===== 特殊颜色 =====
  219. // Sidebar 专用颜色
  220. $sidebar-bg: #FFFFFF; // 白色背景
  221. $sidebar-text-color: #5E5E66; // 默认文字色(加深)
  222. $sidebar-hover-bg: #F3F4F6; // 悬停背景
  223. $sidebar-active-color: #131212; // 激活文字色(深灰近黑)
  224. // 边框颜色别名
  225. $border-color: $border-base;
  226. // 占位符文字颜色
  227. $text-placeholder: $text-hint;
  228. // 主色悬停
  229. $primary-color-hover: $primary-light;
  230. // 缓动别名
  231. $ease-base: $easing-default;
  232. // 卡片图标背景色
  233. $icon-bg-blue: #EFF6FF;
  234. $icon-bg-indigo: #EEF2FF;
  235. $icon-bg-teal: #F0FDFA;
  236. $icon-bg-purple: #FAF5FF;
  237. $icon-bg-rose: #FFF1F2;
  238. $icon-bg-cyan: #ECFEFF;
  239. $icon-bg-amber: #FFFBEB;
  240. // 标签颜色
  241. $tag-bg-slate: #F1F5F9;
  242. $tag-text-slate: #64748B;
  243. $tag-bg-blue: #E6F7FA; // 更新为企业蓝浅色
  244. $tag-text-blue: #005D80; // 更新为企业蓝色
  245. $tag-bg-indigo: #E0E7FF;
  246. $tag-text-indigo: #4338CA;
  247. $tag-bg-teal: #CCFBF1;
  248. $tag-text-teal: #0D9488;
  249. $tag-bg-purple: #F3E8FF;
  250. $tag-text-purple: #7E22CE;
  251. $tag-bg-rose: #FFE4E6;
  252. $tag-text-rose: #E11D48;
  253. $tag-bg-cyan: #CFFAFE;
  254. $tag-text-cyan: #0891B2;
  255. $tag-bg-amber: #FEF3C7;
  256. $tag-text-amber: #B45309;
  257. // ===== 混合宏定义 =====
  258. // 文字截断
  259. @mixin text-truncate {
  260. overflow: hidden;
  261. text-overflow: ellipsis;
  262. white-space: nowrap;
  263. }
  264. .text-truncate {
  265. @include text-truncate;
  266. }
  267. // 多行文字截断
  268. @mixin text-clamp($lines: 2) {
  269. display: -webkit-box;
  270. -webkit-line-clamp: $lines;
  271. -webkit-box-orient: vertical;
  272. overflow: hidden;
  273. }
  274. // 居中
  275. @mixin center-flex {
  276. display: flex;
  277. justify-content: center;
  278. align-items: center;
  279. }
  280. // 隐藏滚动条
  281. @mixin hide-scrollbar {
  282. &::-webkit-scrollbar {
  283. display: none;
  284. }
  285. -ms-overflow-style: none;
  286. scrollbar-width: none;
  287. }
  288. // 细边框
  289. @mixin hairline-border {
  290. position: relative;
  291. &::after {
  292. content: '';
  293. position: absolute;
  294. bottom: 0;
  295. left: 0;
  296. right: 0;
  297. height: 1px;
  298. background: $border-base;
  299. transform: scaleY(0.5);
  300. }
  301. }
  302. // 渐变背景(v3.2 更新为企业蓝色渐变)
  303. @mixin gradient-primary {
  304. background: linear-gradient(135deg, $primary-gradient-start 0%, $primary-color 100%);
  305. }
  306. // Chat 渐变背景(universalChat 使用)
  307. @mixin gradient-chat {
  308. background: linear-gradient(135deg, $chat-primary-start 0%, $chat-primary-end 100%);
  309. }
  310. // 阴影快捷方式
  311. @mixin shadow-card {
  312. box-shadow: $shadow-sm;
  313. &:hover {
  314. box-shadow: $shadow-lg;
  315. }
  316. }
  317. // 过渡快捷方式
  318. @mixin transition-base {
  319. transition: $transition-base;
  320. }
  321. @mixin transition-transform {
  322. transition: transform $animation-base $easing-default;
  323. }
  324. // 响应式 Mixins
  325. @mixin media-mobile {
  326. @media (max-width: $screen-md) {
  327. @content;
  328. }
  329. }
  330. @mixin media-tablet {
  331. @media (min-width: $screen-md) and (max-width: $screen-lg) {
  332. @content;
  333. }
  334. }
  335. @mixin media-desktop {
  336. @media (min-width: $screen-lg) {
  337. @content;
  338. }
  339. }
  340. // ===== 变量别名(兼容性)=====
  341. // 字体大小别名
  342. $font-size-base: $font-base;
  343. $font-size-xs: $font-xs;
  344. $font-size-sm: $font-sm;
  345. $font-size-md: $font-md;
  346. $font-size-lg: $font-lg;
  347. $font-size-xl: $font-xl;
  348. // 字重别名(兼容简写)
  349. $font-normal: $font-weight-normal;
  350. $font-medium: $font-weight-medium;
  351. $font-semibold: $font-weight-semibold;
  352. $font-bold: $font-weight-bold;
  353. // 圆角别名
  354. $border-radius-base: $radius-md;
  355. $border-radius-sm: $radius-sm;
  356. $border-radius-md: $radius-md;
  357. $border-radius-lg: $radius-lg;
  358. // 主题文字颜色
  359. $theme-text-color: $text-primary;