Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

login.component.scss 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. /* 基础样式 */
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. box-sizing: border-box;
  6. }
  7. :host {
  8. display: flex;
  9. height: 100vh;
  10. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  11. align-items: center;
  12. justify-content: center;
  13. }
  14. /* 登录容器 */
  15. .login-container {
  16. width: 100%;
  17. max-width: 420px;
  18. padding: 20px;
  19. }
  20. /* 登录卡片 */
  21. .login-card {
  22. background: white;
  23. border-radius: 16px;
  24. box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  25. overflow: hidden;
  26. transition: transform 0.3s ease, box-shadow 0.3s ease;
  27. }
  28. .login-card:hover {
  29. transform: translateY(-4px);
  30. box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
  31. }
  32. /* 卡片头部 */
  33. .card-header {
  34. padding: 40px;
  35. display: flex;
  36. flex-direction: column;
  37. justify-content: center;
  38. align-items: center;
  39. background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  40. color: white;
  41. }
  42. .logo-container {
  43. display: flex;
  44. flex-direction: column;
  45. align-items: center;
  46. gap: 16px;
  47. }
  48. .logo-icon {
  49. width: 64px;
  50. height: 64px;
  51. background: rgba(255, 255, 255, 0.2);
  52. border-radius: 16px;
  53. display: flex;
  54. align-items: center;
  55. justify-content: center;
  56. backdrop-filter: blur(10px);
  57. }
  58. .logo-icon .icon {
  59. font-size: 32px;
  60. width: 32px;
  61. height: 32px;
  62. color: white;
  63. }
  64. .title {
  65. font-size: 24px;
  66. font-weight: 600;
  67. letter-spacing: 0.5px;
  68. }
  69. .subtitle {
  70. font-size: 14px;
  71. opacity: 0.9;
  72. margin-top: 8px;
  73. }
  74. /* 表单区域 */
  75. .login-form {
  76. padding: 40px;
  77. }
  78. .form-group {
  79. margin-bottom: 24px;
  80. }
  81. .full-width {
  82. width: 100%;
  83. }
  84. /* 错误消息 */
  85. .error-message {
  86. background-color: #fee2e2;
  87. border: 1px solid #fecaca;
  88. border-radius: 8px;
  89. padding: 12px 16px;
  90. margin-bottom: 24px;
  91. display: flex;
  92. align-items: center;
  93. gap: 10px;
  94. color: #dc2626;
  95. font-size: 14px;
  96. animation: fadeIn 0.3s ease;
  97. }
  98. .error-message .mat-icon {
  99. font-size: 20px;
  100. width: 20px;
  101. height: 20px;
  102. color: #dc2626;
  103. }
  104. /* 登录按钮 */
  105. .login-button {
  106. width: 100%;
  107. height: 48px;
  108. border-radius: 12px;
  109. font-weight: 600;
  110. font-size: 15px;
  111. letter-spacing: 0.5px;
  112. text-transform: none;
  113. transition: all 0.3s ease;
  114. position: relative;
  115. overflow: hidden;
  116. }
  117. .login-button:not(:disabled) {
  118. background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  119. }
  120. .login-button:not(:disabled):hover {
  121. transform: translateY(-2px);
  122. box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
  123. }
  124. .login-button:disabled {
  125. background: #e2e8f0;
  126. color: #94a3b8;
  127. cursor: not-allowed;
  128. }
  129. .button-content {
  130. display: flex;
  131. align-items: center;
  132. justify-content: center;
  133. gap: 8px;
  134. }
  135. .button-content .mat-icon {
  136. font-size: 20px;
  137. width: 20px;
  138. height: 20px;
  139. }
  140. ::ng-deep .spinner {
  141. margin: 0 auto;
  142. }
  143. ::ng-deep .spinner .mdc-circular-progress__indeterminate-container circle {
  144. stroke: white !important;
  145. }
  146. /* 卡片底部 */
  147. .card-footer {
  148. padding: 24px 40px;
  149. background-color: #f8fafc;
  150. border-top: 1px solid #e2e8f0;
  151. text-align: center;
  152. font-size: 13px;
  153. color: #64748b;
  154. line-height: 1.5;
  155. }
  156. .card-footer p:first-child {
  157. margin-bottom: 8px;
  158. color: #4f46e5;
  159. font-weight: 500;
  160. }
  161. .card-footer p:last-child {
  162. font-size: 12px;
  163. }
  164. /* 动画 */
  165. @keyframes fadeIn {
  166. from {
  167. opacity: 0;
  168. transform: translateY(-10px);
  169. }
  170. to {
  171. opacity: 1;
  172. transform: translateY(0);
  173. }
  174. }
  175. /* 响应式设计 */
  176. @media (max-width: 480px) {
  177. .login-card {
  178. margin: 0 10px;
  179. }
  180. .card-header,
  181. .login-form {
  182. padding: 30px 24px;
  183. }
  184. .card-footer {
  185. padding: 20px 24px;
  186. }
  187. }
  188. /* 简洁版:只修复连接线,调整边框颜色 */
  189. :host ::ng-deep {
  190. .mat-mdc-form-field {
  191. /* 核心修复:只去除 leading 的右边框 */
  192. .mdc-notched-outline__leading {
  193. border-right: none !important;
  194. }
  195. /* 核心修复:只去除 notch 的左右边框 */
  196. .mdc-notched-outline__notch {
  197. border-left: none !important;
  198. border-right: none !important;
  199. }
  200. /* 图标无右边框 */
  201. .mat-mdc-form-field-icon-prefix {
  202. border-right: none !important;
  203. }
  204. /* 调整边框颜色,与整体设计协调 */
  205. .mdc-text-field--outlined {
  206. .mdc-notched-outline {
  207. .mdc-notched-outline__leading,
  208. .mdc-notched-outline__notch,
  209. .mdc-notched-outline__trailing {
  210. border-color: #cbd5e1 !important; /* 更柔和的灰色 */
  211. }
  212. }
  213. /* 聚焦状态使用主题色 */
  214. &.mdc-text-field--focused .mdc-notched-outline {
  215. .mdc-notched-outline__leading,
  216. .mdc-notched-outline__notch,
  217. .mdc-notched-outline__trailing {
  218. border-color: #7c3aed !important; /* 使用你的紫色主题色 */
  219. }
  220. }
  221. }
  222. }
  223. }