customer-service-layout.scss 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  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. .top-navbar {
  22. display: flex;
  23. align-items: center;
  24. justify-content: space-between;
  25. padding: 0 24px;
  26. height: 64px;
  27. background-color: $background-primary;
  28. border-bottom: 1px solid $border-color;
  29. box-shadow: $shadow-sm;
  30. position: sticky;
  31. top: 0;
  32. z-index: 1000;
  33. .navbar-left {
  34. display: flex;
  35. align-items: center;
  36. gap: 16px;
  37. }
  38. .menu-toggle {
  39. display: none;
  40. background: none;
  41. border: none;
  42. cursor: pointer;
  43. color: $text-primary;
  44. padding: 8px;
  45. transition: $transition;
  46. &:hover {
  47. color: $primary-color;
  48. }
  49. }
  50. .app-title {
  51. font-size: 20px;
  52. font-weight: 600;
  53. color: $text-primary;
  54. }
  55. .navbar-center {
  56. flex: 1;
  57. max-width: 500px;
  58. margin: 0 20px;
  59. }
  60. .search-container {
  61. display: flex;
  62. align-items: center;
  63. background-color: $background-tertiary;
  64. border-radius: $border-radius;
  65. padding: 6px 12px;
  66. border: 1px solid $border-color;
  67. .search-input {
  68. flex: 1;
  69. background: none;
  70. border: none;
  71. outline: none;
  72. padding: 6px 8px;
  73. font-size: 14px;
  74. color: $text-primary;
  75. &::placeholder {
  76. color: $text-tertiary;
  77. }
  78. }
  79. .search-button {
  80. background: none;
  81. border: none;
  82. cursor: pointer;
  83. color: $text-secondary;
  84. padding: 4px;
  85. transition: $transition;
  86. &:hover {
  87. color: $primary-color;
  88. }
  89. }
  90. }
  91. .navbar-right {
  92. display: flex;
  93. align-items: center;
  94. gap: 16px;
  95. }
  96. .notification-btn {
  97. position: relative;
  98. background: none;
  99. border: none;
  100. cursor: pointer;
  101. color: $text-secondary;
  102. padding: 8px;
  103. transition: $transition;
  104. &:hover {
  105. color: $primary-color;
  106. }
  107. .notification-badge {
  108. position: absolute;
  109. top: 2px;
  110. right: 2px;
  111. background-color: $danger-color;
  112. color: white;
  113. font-size: 10px;
  114. font-weight: 500;
  115. padding: 2px 6px;
  116. border-radius: 10px;
  117. min-width: 18px;
  118. text-align: center;
  119. }
  120. }
  121. .user-profile {
  122. display: flex;
  123. align-items: center;
  124. gap: 8px;
  125. .user-avatar {
  126. width: 36px;
  127. height: 36px;
  128. border-radius: 50%;
  129. object-fit: cover;
  130. }
  131. .user-name {
  132. font-size: 14px;
  133. font-weight: 500;
  134. color: $text-primary;
  135. }
  136. }
  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. position: relative;
  165. &:hover {
  166. background-color: $background-tertiary;
  167. color: $primary-color;
  168. transform: translateX(2px);
  169. }
  170. &.active {
  171. color: white;
  172. background-color: $primary-color;
  173. border-left-color: $primary-color;
  174. font-weight: 600;
  175. box-shadow: 0 4px 8px color-mix(in srgb, $primary-color 20%, transparent);
  176. transform: translateX(2px);
  177. svg {
  178. stroke-width: 2.5;
  179. }
  180. }
  181. }
  182. }
  183. .sidebar-footer {
  184. padding: 16px 24px;
  185. border-top: 1px solid $border-color;
  186. .storage-info {
  187. margin-bottom: 16px;
  188. font-size: 12px;
  189. color: $text-tertiary;
  190. }
  191. .logout-btn {
  192. display: flex;
  193. align-items: center;
  194. gap: 8px;
  195. padding: 8px 12px;
  196. background: none;
  197. border: 1px solid $border-color;
  198. border-radius: $border-radius;
  199. color: $text-secondary;
  200. cursor: pointer;
  201. font-size: 14px;
  202. transition: $transition;
  203. &:hover {
  204. background-color: $background-tertiary;
  205. border-color: $danger-color;
  206. color: $danger-color;
  207. }
  208. &:active {
  209. transform: scale(0.98);
  210. box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  211. }
  212. }
  213. }
  214. &.collapsed {
  215. width: 0;
  216. overflow: hidden;
  217. }
  218. }
  219. // 中间内容区
  220. .content-wrapper {
  221. flex: 1;
  222. overflow-y: auto;
  223. padding: 24px;
  224. transition: $transition;
  225. &.expanded {
  226. width: 100%;
  227. }
  228. }
  229. // 全局按钮点击反馈样式
  230. button,
  231. .btn-primary,
  232. .nav-item,
  233. .view-all-link,
  234. .logout-btn {
  235. &:active {
  236. transform: scale(0.98);
  237. box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  238. transition: transform 0.1s ease;
  239. }
  240. }
  241. .btn-primary {
  242. &:active {
  243. background-color: $primary-dark;
  244. transform: scale(0.98);
  245. box-shadow: 0 2px 4px color-mix(in srgb, $primary-color 40%, transparent);
  246. }
  247. }
  248. .search-button,
  249. .menu-toggle,
  250. .notification-btn {
  251. &:active {
  252. transform: scale(0.95);
  253. }
  254. }
  255. // 通知按钮样式增强
  256. .notification-btn {
  257. &:active {
  258. transform: scale(0.95);
  259. box-shadow: 0 0 0 2px color-mix(in srgb, $primary-color 20%, transparent);
  260. }
  261. // 确保通知按钮有足够的z-index,以免被下拉菜单遮挡
  262. position: relative;
  263. z-index: 1001;
  264. }
  265. // 通知下拉菜单
  266. .notification-dropdown {
  267. position: absolute;
  268. top: 100%;
  269. right: 0;
  270. margin-top: 8px;
  271. width: 360px;
  272. background-color: $background-primary;
  273. border-radius: $border-radius;
  274. box-shadow: $shadow-lg;
  275. z-index: 1000;
  276. border: 1px solid $border-color;
  277. overflow: hidden;
  278. animation: slideDown 0.3s ease-out;
  279. }
  280. @keyframes slideDown {
  281. from {
  282. opacity: 0;
  283. transform: translateY(-10px);
  284. }
  285. to {
  286. opacity: 1;
  287. transform: translateY(0);
  288. }
  289. }
  290. .notification-header {
  291. display: flex;
  292. justify-content: space-between;
  293. align-items: center;
  294. padding: 16px 20px;
  295. border-bottom: 1px solid $border-color;
  296. background-color: $background-tertiary;
  297. h3 {
  298. font-size: 16px;
  299. font-weight: 600;
  300. color: $text-primary;
  301. margin: 0;
  302. }
  303. .close-btn {
  304. background: none;
  305. border: none;
  306. cursor: pointer;
  307. color: $text-secondary;
  308. padding: 4px;
  309. transition: $transition;
  310. &:hover {
  311. color: $text-primary;
  312. }
  313. &:active {
  314. transform: scale(0.9);
  315. }
  316. }
  317. }
  318. .notification-list {
  319. max-height: 400px;
  320. overflow-y: auto;
  321. .notification-item {
  322. display: flex;
  323. align-items: flex-start;
  324. gap: 12px;
  325. padding: 16px 20px;
  326. border-bottom: 1px solid $border-color;
  327. transition: $transition;
  328. &:hover {
  329. background-color: $background-tertiary;
  330. }
  331. &:last-child {
  332. border-bottom: none;
  333. }
  334. .notification-icon {
  335. flex-shrink: 0;
  336. width: 32px;
  337. height: 32px;
  338. border-radius: 50%;
  339. background-color: color-mix(in srgb, $primary-color 10%, transparent);
  340. display: flex;
  341. align-items: center;
  342. justify-content: center;
  343. color: $primary-color;
  344. margin-top: 2px;
  345. }
  346. .notification-content {
  347. flex: 1;
  348. p {
  349. margin: 0;
  350. font-size: 14px;
  351. color: $text-secondary;
  352. line-height: 1.4;
  353. }
  354. }
  355. }
  356. }
  357. .notification-footer {
  358. padding: 12px 20px;
  359. text-align: center;
  360. background-color: $background-tertiary;
  361. border-top: 1px solid $border-color;
  362. .view-all {
  363. color: $primary-color;
  364. text-decoration: none;
  365. font-size: 14px;
  366. font-weight: 500;
  367. transition: $transition;
  368. &:hover {
  369. text-decoration: underline;
  370. color: $primary-dark;
  371. }
  372. }
  373. }
  374. // 响应式设计
  375. @media (max-width: 1024px) {
  376. .sidebar {
  377. width: 200px;
  378. }
  379. }
  380. @media (max-width: 768px) {
  381. .top-navbar {
  382. padding: 0 16px;
  383. .menu-toggle {
  384. display: block;
  385. }
  386. .app-title {
  387. font-size: 18px;
  388. }
  389. .navbar-center {
  390. display: none;
  391. }
  392. }
  393. .sidebar {
  394. position: fixed;
  395. top: 64px;
  396. left: 0;
  397. height: calc(100vh - 64px);
  398. z-index: 900;
  399. transform: translateX(0);
  400. &.collapsed {
  401. transform: translateX(-100%);
  402. }
  403. }
  404. .content-wrapper {
  405. padding: 16px;
  406. margin-left: 0;
  407. }
  408. }
  409. @media (max-width: 480px) {
  410. .top-navbar {
  411. height: 56px;
  412. .navbar-right {
  413. gap: 12px;
  414. }
  415. }
  416. .sidebar {
  417. top: 56px;
  418. height: calc(100vh - 56px);
  419. }
  420. .content-wrapper {
  421. padding: 12px;
  422. }
  423. }