login.css 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. /* 登录/注册页面样式 */
  2. * {
  3. margin: 0;
  4. padding: 0;
  5. box-sizing: border-box;
  6. }
  7. body {
  8. margin: 0;
  9. padding: 0;
  10. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
  11. "Noto Sans", sans-serif;
  12. overflow: hidden;
  13. }
  14. /* 半透明背景遮罩 */
  15. .login-overlay {
  16. position: fixed;
  17. top: 0;
  18. left: 0;
  19. width: 100%;
  20. height: 100%;
  21. background: rgba(0, 0, 0, 0.6);
  22. z-index: 1000000;
  23. backdrop-filter: blur(4px);
  24. -webkit-backdrop-filter: blur(4px);
  25. animation: fadeIn 0.3s ease;
  26. }
  27. @keyframes fadeIn {
  28. from {
  29. opacity: 0;
  30. }
  31. to {
  32. opacity: 1;
  33. }
  34. }
  35. /* 登录容器 */
  36. .login-container {
  37. position: fixed;
  38. top: 50%;
  39. left: 50%;
  40. transform: translate(-50%, -50%);
  41. width: 480px;
  42. max-width: 90vw;
  43. max-height: 90vh;
  44. background: #ffffff;
  45. border-radius: 16px;
  46. box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  47. z-index: 1000001;
  48. animation: slideUp 0.3s ease;
  49. overflow-y: auto;
  50. }
  51. @keyframes slideUp {
  52. from {
  53. opacity: 0;
  54. transform: translate(-50%, -40%);
  55. }
  56. to {
  57. opacity: 1;
  58. transform: translate(-50%, -50%);
  59. }
  60. }
  61. /* 关闭按钮 */
  62. .close-btn {
  63. position: absolute;
  64. top: 16px;
  65. right: 16px;
  66. width: 32px;
  67. height: 32px;
  68. border: none;
  69. background: #f3f4f6;
  70. border-radius: 50%;
  71. font-size: 24px;
  72. line-height: 1;
  73. color: #6b7280;
  74. cursor: pointer;
  75. transition: all 0.2s ease;
  76. z-index: 10;
  77. display: flex;
  78. align-items: center;
  79. justify-content: center;
  80. }
  81. .close-btn:hover {
  82. background: #e5e7eb;
  83. color: #374151;
  84. }
  85. /* 标签切换 */
  86. .tab-switcher {
  87. display: flex;
  88. border-bottom: 2px solid #e5e7eb;
  89. padding: 0 24px;
  90. margin-top: 24px;
  91. }
  92. .tab-btn {
  93. flex: 1;
  94. padding: 16px 0;
  95. border: none;
  96. background: transparent;
  97. font-size: 16px;
  98. font-weight: 600;
  99. color: #6b7280;
  100. cursor: pointer;
  101. transition: all 0.3s ease;
  102. position: relative;
  103. }
  104. .tab-btn.active {
  105. color: #8b5cf6;
  106. }
  107. .tab-btn.active::after {
  108. content: '';
  109. position: absolute;
  110. bottom: -2px;
  111. left: 0;
  112. right: 0;
  113. height: 2px;
  114. background: #8b5cf6;
  115. }
  116. .tab-btn:hover {
  117. color: #8b5cf6;
  118. }
  119. /* 表单容器 */
  120. .form-container {
  121. padding: 32px 24px;
  122. }
  123. /* 登录方式切换 */
  124. .login-type-switcher {
  125. display: flex;
  126. gap: 8px;
  127. margin-bottom: 24px;
  128. background: #f9fafb;
  129. padding: 4px;
  130. border-radius: 8px;
  131. }
  132. .type-btn {
  133. flex: 1;
  134. padding: 8px 16px;
  135. border: none;
  136. background: transparent;
  137. font-size: 14px;
  138. color: #6b7280;
  139. border-radius: 6px;
  140. cursor: pointer;
  141. transition: all 0.2s ease;
  142. }
  143. .type-btn.active {
  144. background: #ffffff;
  145. color: #8b5cf6;
  146. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  147. }
  148. .type-btn:hover {
  149. color: #8b5cf6;
  150. }
  151. .login-type-content {
  152. animation: fadeIn 0.3s ease;
  153. }
  154. /* 表单组 */
  155. .form-group {
  156. margin-bottom: 20px;
  157. }
  158. .form-group label {
  159. display: block;
  160. margin-bottom: 8px;
  161. font-size: 14px;
  162. font-weight: 600;
  163. color: #374151;
  164. }
  165. .form-group input[type="text"],
  166. .form-group input[type="password"],
  167. .form-group input[type="tel"] {
  168. width: 100%;
  169. padding: 12px 16px;
  170. font-size: 14px;
  171. border: 2px solid #e5e7eb;
  172. border-radius: 8px;
  173. transition: all 0.2s ease;
  174. outline: none;
  175. }
  176. .form-group input:focus {
  177. border-color: #8b5cf6;
  178. box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  179. }
  180. .form-group input::placeholder {
  181. color: #9ca3af;
  182. }
  183. /* 验证码输入组 */
  184. .code-input-group {
  185. display: flex;
  186. gap: 12px;
  187. }
  188. .code-input-group input {
  189. flex: 1;
  190. }
  191. .code-btn {
  192. padding: 12px 20px;
  193. border: 2px solid #8b5cf6;
  194. background: #ffffff;
  195. color: #8b5cf6;
  196. font-size: 14px;
  197. font-weight: 600;
  198. border-radius: 8px;
  199. cursor: pointer;
  200. transition: all 0.2s ease;
  201. white-space: nowrap;
  202. }
  203. .code-btn:hover:not(:disabled) {
  204. background: #8b5cf6;
  205. color: #ffffff;
  206. }
  207. .code-btn:disabled {
  208. opacity: 0.6;
  209. cursor: not-allowed;
  210. }
  211. .code-btn.countdown {
  212. color: #6b7280;
  213. border-color: #d1d5db;
  214. }
  215. /* 密码提示 */
  216. .password-hint {
  217. margin-top: 6px;
  218. }
  219. .hint-text {
  220. font-size: 12px;
  221. color: #6b7280;
  222. line-height: 1.5;
  223. }
  224. /* 头像上传 */
  225. .avatar-upload {
  226. display: flex;
  227. align-items: center;
  228. justify-content: center;
  229. }
  230. .avatar-preview {
  231. width: 80px;
  232. height: 80px;
  233. border: 2px dashed #d1d5db;
  234. border-radius: 50%;
  235. display: flex;
  236. align-items: center;
  237. justify-content: center;
  238. cursor: pointer;
  239. transition: all 0.2s ease;
  240. overflow: hidden;
  241. background: #f9fafb;
  242. }
  243. .avatar-preview:hover {
  244. border-color: #8b5cf6;
  245. background: #faf5ff;
  246. }
  247. .avatar-preview img {
  248. width: 100%;
  249. height: 100%;
  250. object-fit: cover;
  251. }
  252. .avatar-placeholder {
  253. font-size: 12px;
  254. color: #9ca3af;
  255. text-align: center;
  256. }
  257. /* 提交按钮 */
  258. .submit-btn {
  259. width: 100%;
  260. padding: 14px;
  261. margin-top: 8px;
  262. border: none;
  263. background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
  264. color: #ffffff;
  265. font-size: 16px;
  266. font-weight: 600;
  267. border-radius: 8px;
  268. cursor: pointer;
  269. transition: all 0.3s ease;
  270. box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  271. }
  272. .submit-btn:hover {
  273. background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
  274. transform: translateY(-2px);
  275. box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
  276. }
  277. .submit-btn:active {
  278. transform: translateY(0);
  279. }
  280. .submit-btn:disabled {
  281. opacity: 0.6;
  282. cursor: not-allowed;
  283. transform: none;
  284. }
  285. /* 错误提示 */
  286. .error-message {
  287. margin-top: 12px;
  288. margin-bottom: 8px;
  289. padding: 10px 16px;
  290. font-size: 14px;
  291. color: #ef4444;
  292. background-color: #fef2f2;
  293. border: 1px solid #fecaca;
  294. border-radius: 8px;
  295. display: none;
  296. text-align: center;
  297. }
  298. .error-message.show {
  299. display: block;
  300. animation: fadeIn 0.3s ease;
  301. }
  302. /* 响应式设计 */
  303. @media (max-width: 600px) {
  304. .login-container {
  305. width: 95vw;
  306. max-height: 95vh;
  307. }
  308. .form-container {
  309. padding: 24px 16px;
  310. }
  311. .code-input-group {
  312. flex-direction: column;
  313. }
  314. .code-btn {
  315. width: 100%;
  316. }
  317. }