app.scss 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. // 全局变量定义
  2. $primary-color: #165DFF;
  3. $primary-dark: #0E42CB;
  4. $secondary-color: #4E5BA6;
  5. $success-color: #00B42A;
  6. $warning-color: #FF7D00;
  7. $danger-color: #F53F3F;
  8. $text-primary: #1D2129;
  9. $text-secondary: #4E5969;
  10. $text-tertiary: #86909C;
  11. $border-color: #E5E6EB;
  12. $background-primary: #FFFFFF;
  13. $background-secondary: #F2F3F5;
  14. $background-tertiary: #F7F8FA;
  15. $shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  16. $shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  17. $shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
  18. $border-radius: 8px;
  19. $transition: all 0.3s ease;
  20. // 全局样式重置
  21. * {
  22. margin: 0;
  23. padding: 0;
  24. box-sizing: border-box;
  25. }
  26. body {
  27. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  28. color: $text-primary;
  29. background-color: $background-secondary;
  30. }
  31. // 主容器
  32. .app-container {
  33. display: flex;
  34. flex-direction: column;
  35. height: 100vh;
  36. overflow-y: auto;
  37. }
  38. // 顶部导航栏
  39. top-navbar {
  40. display: flex;
  41. align-items: center;
  42. justify-content: space-between;
  43. padding: 0 24px;
  44. height: 64px;
  45. background-color: $background-primary;
  46. box-shadow: $shadow-sm;
  47. z-index: 1000;
  48. }
  49. .navbar-left {
  50. display: flex;
  51. align-items: center;
  52. gap: 16px;
  53. }
  54. .app-title {
  55. font-size: 20px;
  56. font-weight: 600;
  57. color: $primary-color;
  58. margin: 0;
  59. }
  60. .navbar-center {
  61. display: flex;
  62. flex: 1;
  63. max-width: 400px;
  64. margin: 0 24px;
  65. }
  66. .search-container {
  67. position: relative;
  68. width: 100%;
  69. }
  70. .search-input {
  71. width: 100%;
  72. padding: 8px 12px 8px 36px;
  73. border: 1px solid $border-color;
  74. border-radius: $border-radius;
  75. font-size: 14px;
  76. transition: $transition;
  77. }
  78. .search-input:focus {
  79. outline: none;
  80. border-color: $primary-color;
  81. box-shadow: 0 0 0 2px color-mix(in srgb, $primary-color 20%, transparent);
  82. }
  83. .search-icon {
  84. position: absolute;
  85. left: 12px;
  86. top: 50%;
  87. transform: translateY(-50%);
  88. color: $text-tertiary;
  89. }
  90. .navbar-right {
  91. display: flex;
  92. align-items: center;
  93. gap: 16px;
  94. }
  95. .notification-btn {
  96. position: relative;
  97. background: none;
  98. border: none;
  99. cursor: pointer;
  100. color: $text-secondary;
  101. transition: $transition;
  102. }
  103. .notification-btn:hover {
  104. color: $primary-color;
  105. }
  106. .notification-badge {
  107. position: absolute;
  108. top: -4px;
  109. right: -4px;
  110. background-color: $danger-color;
  111. color: white;
  112. font-size: 10px;
  113. padding: 2px 4px;
  114. border-radius: 8px;
  115. min-width: 16px;
  116. text-align: center;
  117. }
  118. .user-profile {
  119. display: flex;
  120. align-items: center;
  121. gap: 8px;
  122. }
  123. .user-avatar {
  124. width: 36px;
  125. height: 36px;
  126. border-radius: 50%;
  127. background-color: $primary-color;
  128. color: white;
  129. display: flex;
  130. align-items: center;
  131. justify-content: center;
  132. font-weight: 500;
  133. }
  134. .user-name {
  135. font-size: 14px;
  136. color: $text-secondary;
  137. }
  138. // 主要内容区
  139. .main-content {
  140. display: flex;
  141. flex: 1;
  142. overflow: hidden;
  143. }
  144. // 左侧侧边栏
  145. .sidebar {
  146. width: 220px;
  147. background-color: $background-primary;
  148. border-right: 1px solid $border-color;
  149. display: flex;
  150. flex-direction: column;
  151. transition: $transition;
  152. .sidebar-nav {
  153. flex: 1;
  154. padding: 16px 0;
  155. .nav-item {
  156. display: flex;
  157. align-items: center;
  158. gap: 12px;
  159. padding: 12px 24px;
  160. color: $text-secondary;
  161. text-decoration: none;
  162. border-left: 3px solid transparent;
  163. transition: $transition;
  164. &:hover {
  165. background-color: $background-tertiary;
  166. color: $primary-color;
  167. }
  168. &.active {
  169. color: $primary-color;
  170. background-color: color-mix(in srgb, $primary-color 5%, transparent);
  171. border-left-color: $primary-color;
  172. font-weight: 500;
  173. }
  174. }
  175. }
  176. .sidebar-footer {
  177. padding: 16px 24px;
  178. border-top: 1px solid $border-color;
  179. .storage-info {
  180. margin-bottom: 16px;
  181. font-size: 12px;
  182. color: $text-tertiary;
  183. }
  184. .logout-btn {
  185. display: flex;
  186. align-items: center;
  187. gap: 8px;
  188. padding: 8px 12px;
  189. background: none;
  190. border: 1px solid $border-color;
  191. border-radius: $border-radius;
  192. color: $text-secondary;
  193. cursor: pointer;
  194. font-size: 14px;
  195. transition: $transition;
  196. &:hover {
  197. background-color: $background-tertiary;
  198. border-color: $danger-color;
  199. color: $danger-color;
  200. }
  201. }
  202. }
  203. &.collapsed {
  204. width: 0;
  205. overflow: hidden;
  206. }
  207. }
  208. // 设计师页面特定规则 - 彻底隐藏侧边栏
  209. .designer-page .sidebar {
  210. display: none !important;
  211. width: 0 !important;
  212. visibility: hidden !important;
  213. position: absolute !important;
  214. left: -9999px !important;
  215. }
  216. .designer-page .content-wrapper {
  217. width: 100% !important;
  218. margin-left: 0 !important;
  219. padding: 20px !important;
  220. }
  221. .designer-page .main-content {
  222. padding: 0 !important;
  223. margin: 0 !important;
  224. }
  225. // 中间内容区
  226. .content-wrapper {
  227. flex: 1;
  228. padding: 20px;
  229. overflow-y: auto;
  230. }
  231. // 响应式设计
  232. @media (max-width: 1024px) {
  233. .sidebar {
  234. width: 200px;
  235. }
  236. }
  237. @media (max-width: 768px) {
  238. .top-navbar {
  239. padding: 0 16px;
  240. }
  241. .menu-toggle {
  242. display: block;
  243. }
  244. .app-title {
  245. font-size: 18px;
  246. }
  247. .navbar-center {
  248. display: none;
  249. }
  250. .sidebar {
  251. position: fixed;
  252. top: 64px;
  253. left: 0;
  254. height: calc(100vh - 64px);
  255. z-index: 900;
  256. transform: translateX(0);
  257. &.collapsed {
  258. transform: translateX(-100%);
  259. }
  260. }
  261. .content-wrapper {
  262. padding: 16px;
  263. margin-left: 0;
  264. }
  265. }
  266. @media (max-width: 480px) {
  267. .top-navbar {
  268. height: 56px;
  269. .navbar-right {
  270. gap: 12px;
  271. }
  272. }
  273. .sidebar {
  274. top: 56px;
  275. height: calc(100vh - 56px);
  276. }
  277. .content-wrapper {
  278. padding: 12px;
  279. }
  280. }