index.css 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. /* 小程序登录页样式 - 符合16-mini-program-ui.md规范 */
  2. /* 1. 设计原则 - 简洁直观、一致性、响应迅速、易用性 */
  3. /* 页面容器 - 使用品牌主色渐变背景 */
  4. .login-container {
  5. min-height: 100vh;
  6. background: linear-gradient(180deg, #1890ff 0%, #096dd9 100%);
  7. padding: 64rpx 32rpx;
  8. display: flex;
  9. flex-direction: column;
  10. justify-content: center;
  11. align-items: center;
  12. box-sizing: border-box;
  13. position: relative;
  14. overflow: hidden;
  15. }
  16. /* 背景装饰 - 符合简洁原则 */
  17. .login-container::before {
  18. content: '';
  19. position: absolute;
  20. top: 0;
  21. left: 0;
  22. right: 0;
  23. bottom: 0;
  24. background: url('https://source.unsplash.com/800x1200/?abstract,blue,light') center/cover;
  25. opacity: 0.1;
  26. filter: blur(2rpx);
  27. }
  28. /* 2. 视觉规范 - 色彩系统 */
  29. /* 主色调应用 */
  30. .login-header {
  31. text-align: center;
  32. margin-bottom: 96rpx;
  33. position: relative;
  34. z-index: 1;
  35. }
  36. /* Logo样式 - 符合图标规范 */
  37. .login-logo {
  38. width: 160rpx;
  39. height: 160rpx;
  40. border-radius: 50%;
  41. margin-bottom: 48rpx;
  42. box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.12);
  43. border: 4rpx solid rgba(255, 255, 255, 0.3);
  44. background: #ffffff;
  45. }
  46. /* 标题样式 - 符合字体规范 */
  47. .login-title-container {
  48. margin-top: 32rpx;
  49. }
  50. .login-title {
  51. display: block;
  52. font-size: 48rpx;
  53. font-weight: 600;
  54. color: #ffffff;
  55. margin-bottom: 16rpx;
  56. letter-spacing: 1rpx;
  57. line-height: 1.3;
  58. }
  59. .login-subtitle {
  60. display: block;
  61. font-size: 32rpx;
  62. color: rgba(255, 255, 255, 0.85);
  63. line-height: 1.5;
  64. font-weight: 400;
  65. }
  66. /* 3. 组件规范 - 卡片样式 */
  67. /* 表单区域 - 使用卡片规范 */
  68. .login-form {
  69. width: 100%;
  70. max-width: 640rpx;
  71. background: #ffffff;
  72. border-radius: 24rpx;
  73. padding: 64rpx 48rpx;
  74. box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.08);
  75. position: relative;
  76. z-index: 1;
  77. }
  78. /* 表单间距 - 符合间距规范 */
  79. .form-item {
  80. margin-bottom: 48rpx;
  81. }
  82. .form-label {
  83. display: block;
  84. font-size: 32rpx;
  85. color: #262626;
  86. margin-bottom: 16rpx;
  87. font-weight: 500;
  88. }
  89. /* 输入框样式 - 符合输入框规范 */
  90. .input-wrapper {
  91. position: relative;
  92. }
  93. .form-input {
  94. width: 100%;
  95. height: 96rpx;
  96. border: 2rpx solid #d9d9d9;
  97. border-radius: 12rpx;
  98. padding: 0 32rpx;
  99. font-size: 32rpx;
  100. color: #262626;
  101. box-sizing: border-box;
  102. background: #fafafa;
  103. transition: all 0.2s ease;
  104. }
  105. .form-input:focus {
  106. border-color: #1890ff;
  107. background: #ffffff;
  108. box-shadow: 0 0 0 4rpx rgba(24, 144, 255, 0.2);
  109. }
  110. .form-input::placeholder {
  111. color: #8c8c8c;
  112. font-size: 32rpx;
  113. }
  114. /* 4. 按钮规范 - 主要按钮样式 */
  115. .login-button {
  116. width: 100%;
  117. height: 96rpx;
  118. background: #1890ff;
  119. color: #ffffff;
  120. border-radius: 12rpx;
  121. font-size: 36rpx;
  122. font-weight: 500;
  123. margin-top: 64rpx;
  124. transition: all 0.2s ease;
  125. box-shadow: 0 4rpx 16rpx rgba(24, 144, 255, 0.3);
  126. position: relative;
  127. overflow: hidden;
  128. }
  129. .login-button:active {
  130. transform: scale(0.98);
  131. box-shadow: 0 2rpx 8rpx rgba(24, 144, 255, 0.2);
  132. }
  133. .login-button.loading {
  134. opacity: 0.7;
  135. transform: scale(0.98);
  136. }
  137. .login-button:disabled {
  138. background: #bfbfbf;
  139. color: #ffffff;
  140. box-shadow: none;
  141. }
  142. /* 5. 页脚样式 */
  143. .login-footer {
  144. text-align: center;
  145. margin-top: 48rpx;
  146. }
  147. .footer-text {
  148. font-size: 32rpx;
  149. color: rgba(255, 255, 255, 0.9);
  150. font-weight: 400;
  151. }
  152. .link-text {
  153. color: #ffffff;
  154. font-size: 32rpx;
  155. font-weight: 500;
  156. text-decoration: underline;
  157. }
  158. .link-text:active {
  159. opacity: 0.8;
  160. }
  161. .login-footer-info {
  162. position: absolute;
  163. bottom: 48rpx;
  164. left: 0;
  165. right: 0;
  166. text-align: center;
  167. }
  168. .footer-tip {
  169. font-size: 28rpx;
  170. color: rgba(255, 255, 255, 0.7);
  171. margin-bottom: 8rpx;
  172. font-weight: 400;
  173. }
  174. .footer-links {
  175. display: flex;
  176. justify-content: center;
  177. align-items: center;
  178. gap: 16rpx;
  179. flex-wrap: wrap;
  180. }
  181. .link-separator {
  182. color: rgba(255, 255, 255, 0.7);
  183. font-size: 28rpx;
  184. }
  185. /* 6. 响应式设计 - 适配不同屏幕 */
  186. @media screen and (max-width: 375px) {
  187. .login-container {
  188. padding: 48rpx 24rpx;
  189. }
  190. .login-form {
  191. padding: 48rpx 32rpx;
  192. }
  193. .login-title {
  194. font-size: 42rpx;
  195. }
  196. .login-subtitle {
  197. font-size: 28rpx;
  198. }
  199. .login-logo {
  200. width: 128rpx;
  201. height: 128rpx;
  202. }
  203. }
  204. @media screen and (min-width: 415px) {
  205. .login-container {
  206. padding: 96rpx 48rpx;
  207. }
  208. .login-form {
  209. padding: 80rpx 64rpx;
  210. }
  211. }
  212. /* 7. 深色模式适配 */
  213. @media (prefers-color-scheme: dark) {
  214. .login-container {
  215. background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  216. }
  217. .login-title {
  218. color: #e6e6e6;
  219. }
  220. .login-subtitle {
  221. color: rgba(230, 230, 230, 0.85);
  222. }
  223. .login-form {
  224. background: #2a2a2a;
  225. box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.3);
  226. }
  227. .form-label {
  228. color: #e6e6e6;
  229. }
  230. .form-input {
  231. background: #3a3a3a;
  232. border-color: #595959;
  233. color: #e6e6e6;
  234. }
  235. .form-input:focus {
  236. border-color: #1890ff;
  237. background: #4a4a4a;
  238. }
  239. .footer-text {
  240. color: rgba(230, 230, 230, 0.9);
  241. }
  242. .link-text {
  243. color: #1890ff;
  244. }
  245. .footer-tip,
  246. .link-separator {
  247. color: rgba(230, 230, 230, 0.7);
  248. }
  249. }
  250. /* 8. 动效规范 - 过渡动画 */
  251. @keyframes fadeInUp {
  252. from {
  253. opacity: 0;
  254. transform: translateY(64rpx);
  255. }
  256. to {
  257. opacity: 1;
  258. transform: translateY(0);
  259. }
  260. }
  261. @keyframes fadeIn {
  262. from {
  263. opacity: 0;
  264. }
  265. to {
  266. opacity: 1;
  267. }
  268. }
  269. .login-header {
  270. animation: fadeIn 0.6s ease-out;
  271. }
  272. .login-form {
  273. animation: fadeInUp 0.8s ease-out;
  274. }
  275. .login-button {
  276. animation: fadeInUp 1s ease-out;
  277. }
  278. /* 9. 触摸反馈 - 微交互 */
  279. .form-item {
  280. transition: transform 0.2s ease;
  281. }
  282. .form-item:active {
  283. transform: scale(0.99);
  284. }
  285. /* 10. 安全区域适配 */
  286. @supports (padding-top: constant(safe-area-inset-top)) {
  287. .login-container {
  288. padding-top: calc(64rpx + constant(safe-area-inset-top));
  289. }
  290. }
  291. @supports (padding-top: env(safe-area-inset-top)) {
  292. .login-container {
  293. padding-top: calc(64rpx + env(safe-area-inset-top));
  294. }
  295. }
  296. @supports (padding-bottom: constant(safe-area-inset-bottom)) {
  297. .login-container {
  298. padding-bottom: calc(64rpx + constant(safe-area-inset-bottom));
  299. }
  300. }
  301. @supports (padding-bottom: env(safe-area-inset-bottom)) {
  302. .login-container {
  303. padding-bottom: calc(64rpx + env(safe-area-inset-bottom));
  304. }
  305. }
  306. /* 11. 辅助样式 */
  307. .hidden {
  308. display: none;
  309. }
  310. .loading-skeleton {
  311. background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  312. background-size: 200% 100%;
  313. animation: loading 1.5s infinite;
  314. }
  315. @keyframes loading {
  316. 0% {
  317. background-position: 200% 0;
  318. }
  319. 100% {
  320. background-position: -200% 0;
  321. }
  322. }