profile.wxss 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. /* pages/profile/profile.wxss */
  2. page {
  3. height: 100%;
  4. width: 100%;
  5. background: linear-gradient(180deg, #f8f9ff 0%, #f5f5f5 100%);
  6. }
  7. .container {
  8. display: flex;
  9. flex-direction: column;
  10. width: 100%;
  11. /* 高度由JS动态设置,如果没有设置则使用100vh作为fallback */
  12. min-height: 100vh;
  13. height: 100vh;
  14. background: linear-gradient(180deg, #f8f9ff 0%, #f5f5f5 100%);
  15. box-sizing: border-box;
  16. /* 确保内容在安全区域内 */
  17. padding: 0;
  18. margin: 0;
  19. }
  20. .user-section {
  21. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  22. padding: 40rpx 30rpx 50rpx;
  23. padding-top: calc(40rpx + env(safe-area-inset-top));
  24. color: #fff;
  25. position: relative;
  26. overflow: hidden;
  27. flex-shrink: 0;
  28. width: 100%;
  29. box-sizing: border-box;
  30. }
  31. .user-section::before {
  32. content: '';
  33. position: absolute;
  34. top: -50%;
  35. right: -20%;
  36. width: 400rpx;
  37. height: 400rpx;
  38. background: rgba(255, 255, 255, 0.1);
  39. border-radius: 50%;
  40. pointer-events: none;
  41. }
  42. .user-section::after {
  43. content: '';
  44. position: absolute;
  45. bottom: -30%;
  46. left: -10%;
  47. width: 300rpx;
  48. height: 300rpx;
  49. background: rgba(255, 255, 255, 0.08);
  50. border-radius: 50%;
  51. pointer-events: none;
  52. }
  53. .user-header {
  54. display: flex;
  55. align-items: center;
  56. position: relative;
  57. z-index: 1;
  58. }
  59. .avatar {
  60. width: 140rpx;
  61. height: 140rpx;
  62. border-radius: 50%;
  63. margin-right: 32rpx;
  64. border: 6rpx solid rgba(255, 255, 255, 0.4);
  65. flex-shrink: 0;
  66. box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.2);
  67. transition: transform 0.3s ease;
  68. }
  69. .avatar:active {
  70. transform: scale(0.95);
  71. }
  72. .user-info {
  73. flex: 1;
  74. min-width: 0;
  75. }
  76. .nickname-row {
  77. display: flex;
  78. align-items: center;
  79. margin-bottom: 16rpx;
  80. gap: 16rpx;
  81. flex-wrap: wrap;
  82. }
  83. .nickname {
  84. font-size: 40rpx;
  85. font-weight: 600;
  86. overflow: hidden;
  87. text-overflow: ellipsis;
  88. white-space: nowrap;
  89. text-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  90. }
  91. .username {
  92. font-size: 26rpx;
  93. opacity: 0.95;
  94. overflow: hidden;
  95. text-overflow: ellipsis;
  96. white-space: nowrap;
  97. font-weight: 500;
  98. }
  99. .vip-badge {
  100. display: inline-block;
  101. padding: 6rpx 18rpx;
  102. background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  103. color: #333;
  104. border-radius: 24rpx;
  105. font-size: 24rpx;
  106. font-weight: bold;
  107. flex-shrink: 0;
  108. box-shadow: 0 4rpx 12rpx rgba(255, 215, 0, 0.4);
  109. border: 2rpx solid rgba(255, 255, 255, 0.3);
  110. }
  111. .menu-section {
  112. background: #fff;
  113. margin: 0;
  114. border-radius: 0;
  115. overflow: hidden;
  116. box-shadow: none;
  117. flex: 1;
  118. display: flex;
  119. flex-direction: column;
  120. width: 100%;
  121. }
  122. .menu-item {
  123. display: flex;
  124. align-items: center;
  125. padding: 36rpx 30rpx;
  126. border-bottom: 1rpx solid #f0f0f0;
  127. transition: all 0.3s ease;
  128. position: relative;
  129. width: 100%;
  130. box-sizing: border-box;
  131. }
  132. .menu-item::before {
  133. content: '';
  134. position: absolute;
  135. left: 0;
  136. top: 0;
  137. bottom: 0;
  138. width: 6rpx;
  139. background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  140. opacity: 0;
  141. transition: opacity 0.3s ease;
  142. }
  143. .menu-item:active {
  144. background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, transparent 100%);
  145. padding-left: 36rpx;
  146. }
  147. .menu-item:active::before {
  148. opacity: 1;
  149. }
  150. .menu-item:last-child {
  151. border-bottom: none;
  152. }
  153. .menu-icon {
  154. font-size: 44rpx;
  155. margin-right: 24rpx;
  156. width: 50rpx;
  157. text-align: center;
  158. transition: transform 0.3s ease;
  159. }
  160. .menu-item:active .menu-icon {
  161. transform: scale(1.1);
  162. }
  163. .menu-text {
  164. flex: 1;
  165. font-size: 30rpx;
  166. color: #1a1a1a;
  167. font-weight: 500;
  168. }
  169. .menu-arrow {
  170. font-size: 28rpx;
  171. color: #999;
  172. transition: transform 0.3s ease;
  173. }
  174. .menu-item:active .menu-arrow {
  175. transform: translateX(4rpx);
  176. color: #667eea;
  177. }
  178. .logout-section {
  179. padding: 30rpx 0 40rpx;
  180. margin-top: auto; /* 将退出登录按钮推到底部,铺满高度 */
  181. flex-shrink: 0;
  182. width: 100%;
  183. box-sizing: border-box;
  184. }
  185. .logout-btn {
  186. width: calc(100% - 60rpx);
  187. margin: 0 30rpx;
  188. height: 96rpx;
  189. line-height: 96rpx;
  190. background: #fff;
  191. color: #ff4444;
  192. border-radius: 16rpx;
  193. font-size: 32rpx;
  194. font-weight: 500;
  195. border: 2rpx solid #ffe0e0;
  196. transition: all 0.3s ease;
  197. box-shadow: 0 4rpx 16rpx rgba(255, 68, 68, 0.1);
  198. }
  199. .logout-btn::after {
  200. border: none;
  201. }
  202. .logout-btn:active {
  203. background: linear-gradient(135deg, #ffe0e0 0%, #fff5f5 100%);
  204. transform: scale(0.98);
  205. box-shadow: 0 2rpx 12rpx rgba(255, 68, 68, 0.15);
  206. }