nav-pc-top-menu.scss 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. .header {
  2. background: rgba(255, 255, 255, 0.95);
  3. box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  4. position: sticky;
  5. top: 0;
  6. z-index: 1000;
  7. padding: 0.8rem 5%;
  8. }
  9. .nav-container {
  10. display: flex;
  11. justify-content: space-between;
  12. align-items: center;
  13. }
  14. .logo {
  15. display: flex;
  16. align-items: center;
  17. }
  18. .logo-icon {
  19. width: 50px;
  20. height: 50px;
  21. background: #2a5daa;
  22. border-radius: 50%;
  23. position: relative;
  24. margin-right: 12px;
  25. display: flex;
  26. justify-content: center;
  27. align-items: center;
  28. color: white;
  29. font-size: 24px;
  30. box-shadow: 0 4px 8px rgba(42, 93, 170, 0.3);
  31. }
  32. .logo-text {
  33. font-size: 1.8rem;
  34. font-weight: bold;
  35. background: linear-gradient(45deg, #2a5daa, #4a86e8);
  36. -webkit-background-clip: text;
  37. background-clip: text;
  38. color: transparent;
  39. letter-spacing: 1px;
  40. }
  41. .logo-subtext {
  42. font-size: 0.9rem;
  43. color: #2a5daa;
  44. margin-top: -4px;
  45. letter-spacing: 3px;
  46. }
  47. .nav-links {
  48. display: flex;
  49. gap: 2rem;
  50. }
  51. .nav-links a {
  52. text-decoration: none;
  53. color: #333;
  54. font-weight: 500;
  55. position: relative;
  56. padding: 0.5rem 0;
  57. transition: all 0.3s ease;
  58. }
  59. .nav-links a:hover {
  60. color: #2a5daa;
  61. }
  62. .nav-links a::after {
  63. content: '';
  64. position: absolute;
  65. bottom: 0;
  66. left: 0;
  67. width: 0;
  68. height: 2px;
  69. background: #2a5daa;
  70. transition: width 0.3s ease;
  71. }
  72. .nav-links a:hover::after {
  73. width: 100%;
  74. }
  75. /* Responsive styles */
  76. @media (max-width: 768px) {
  77. .nav-links {
  78. display: none;
  79. }
  80. .logo-icon {
  81. width: 40px;
  82. height: 40px;
  83. font-size: 20px;
  84. }
  85. .logo-text {
  86. font-size: 1.5rem;
  87. }
  88. .logo-subtext {
  89. font-size: 0.8rem;
  90. }
  91. }
  92. /* 新增用户相关样式 */
  93. .user-section {
  94. display: flex;
  95. align-items: center;
  96. gap: 1rem;
  97. position: relative;
  98. .loading-spinner {
  99. width: 24px;
  100. height: 24px;
  101. border: 3px solid rgba(42, 93, 170, 0.3);
  102. border-radius: 50%;
  103. border-top-color: #2a5daa;
  104. animation: spin 1s linear infinite;
  105. }
  106. @keyframes spin {
  107. to { transform: rotate(360deg); }
  108. }
  109. .btn {
  110. padding: 0.5rem 1rem;
  111. border-radius: 4px;
  112. font-weight: 500;
  113. cursor: pointer;
  114. transition: all 0.3s ease;
  115. &-login {
  116. background: transparent;
  117. border: 1px solid #2a5daa;
  118. color: #2a5daa;
  119. &:hover {
  120. background: #2a5daa;
  121. color: white;
  122. }
  123. }
  124. &-signup {
  125. background: #2a5daa;
  126. border: 1px solid #2a5daa;
  127. color: white;
  128. &:hover {
  129. background: #1d4a8a;
  130. }
  131. }
  132. }
  133. .user-profile {
  134. display: flex;
  135. align-items: center;
  136. gap: 0.5rem;
  137. cursor: pointer;
  138. padding: 0.5rem;
  139. border-radius: 4px;
  140. transition: background 0.3s;
  141. &:hover {
  142. background: rgba(42, 93, 170, 0.1);
  143. }
  144. .avatar {
  145. width: 40px;
  146. height: 40px;
  147. border-radius: 50%;
  148. background: linear-gradient(135deg, #2a5daa, #4a86e8);
  149. color: white;
  150. display: flex;
  151. align-items: center;
  152. justify-content: center;
  153. font-weight: bold;
  154. font-size: 1rem;
  155. img {
  156. width: 100%;
  157. height: 100%;
  158. border-radius: 50%;
  159. object-fit: cover;
  160. }
  161. }
  162. .username {
  163. font-weight: 500;
  164. color: #333;
  165. }
  166. }
  167. .dropdown-menu {
  168. position: absolute;
  169. top: 100%;
  170. right: 0;
  171. background: white;
  172. box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  173. border-radius: 8px;
  174. overflow: hidden;
  175. z-index: 1001;
  176. min-width: 180px;
  177. animation: fadeIn 0.3s ease;
  178. @keyframes fadeIn {
  179. from { opacity: 0; transform: translateY(-10px); }
  180. to { opacity: 1; transform: translateY(0); }
  181. }
  182. .dropdown-item {
  183. display: flex;
  184. align-items: center;
  185. padding: 0.75rem 1.5rem;
  186. text-decoration: none;
  187. color: #333;
  188. transition: all 0.2s;
  189. gap: 0.75rem;
  190. &:hover {
  191. background: #f5f9ff;
  192. color: #2a5daa;
  193. }
  194. i {
  195. width: 20px;
  196. text-align: center;
  197. }
  198. }
  199. }
  200. }
  201. /* 模态框样式 */
  202. .auth-modal-overlay {
  203. position: fixed;
  204. top: 0;
  205. left: 0;
  206. width: 100%;
  207. height: 100%;
  208. background: rgba(0, 0, 0, 0.6);
  209. display: flex;
  210. align-items: center;
  211. justify-content: center;
  212. z-index: 2000;
  213. backdrop-filter: blur(3px);
  214. }
  215. .auth-modal {
  216. background: white;
  217. border-radius: 16px;
  218. width: 400px;
  219. max-width: 90%;
  220. box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  221. position: relative;
  222. overflow: hidden;
  223. .close-btn {
  224. position: absolute;
  225. top: 15px;
  226. right: 15px;
  227. background: none;
  228. border: none;
  229. font-size: 1.2rem;
  230. color: #888;
  231. cursor: pointer;
  232. transition: color 0.3s;
  233. z-index: 10;
  234. &:hover {
  235. color: #2a5daa;
  236. }
  237. }
  238. .auth-tabs {
  239. display: flex;
  240. background: #f8f9fa;
  241. border-bottom: 1px solid #eee;
  242. .tab {
  243. flex: 1;
  244. text-align: center;
  245. padding: 1.2rem;
  246. font-weight: 500;
  247. cursor: pointer;
  248. transition: all 0.3s;
  249. color: #666;
  250. &.active {
  251. color: #2a5daa;
  252. border-bottom: 3px solid #2a5daa;
  253. background: white;
  254. }
  255. &:hover:not(.active) {
  256. background: #f0f4ff;
  257. }
  258. }
  259. }
  260. .auth-form {
  261. padding: 2rem;
  262. .form-group {
  263. position: relative;
  264. margin-bottom: 1.2rem;
  265. i {
  266. position: absolute;
  267. left: 15px;
  268. top: 50%;
  269. transform: translateY(-50%);
  270. color: #888;
  271. }
  272. input {
  273. width: 100%;
  274. padding: 0.8rem 1rem 0.8rem 40px;
  275. border: 1px solid #ddd;
  276. border-radius: 8px;
  277. font-size: 1rem;
  278. transition: border-color 0.3s;
  279. &:focus {
  280. border-color: #2a5daa;
  281. box-shadow: 0 0 0 3px rgba(42, 93, 170, 0.2);
  282. outline: none;
  283. }
  284. }
  285. }
  286. .remember-forgot {
  287. display: flex;
  288. justify-content: space-between;
  289. align-items: center;
  290. margin-bottom: 1.5rem;
  291. font-size: 0.9rem;
  292. label {
  293. display: flex;
  294. align-items: center;
  295. gap: 0.5rem;
  296. }
  297. a {
  298. color: #2a5daa;
  299. text-decoration: none;
  300. &:hover {
  301. text-decoration: underline;
  302. }
  303. }
  304. }
  305. .terms {
  306. margin: 1rem 0 1.5rem;
  307. font-size: 0.9rem;
  308. a {
  309. color: #2a5daa;
  310. text-decoration: none;
  311. &:hover {
  312. text-decoration: underline;
  313. }
  314. }
  315. }
  316. .btn-primary {
  317. width: 100%;
  318. padding: 0.9rem;
  319. background: #2a5daa;
  320. color: white;
  321. border: none;
  322. border-radius: 8px;
  323. font-size: 1rem;
  324. font-weight: 500;
  325. cursor: pointer;
  326. transition: background 0.3s;
  327. &:hover {
  328. background: #1d4a8a;
  329. }
  330. &:disabled {
  331. background: #9bb6e0;
  332. cursor: not-allowed;
  333. }
  334. }
  335. .social-login {
  336. text-align: center;
  337. margin-top: 1.5rem;
  338. padding-top: 1.5rem;
  339. border-top: 1px solid #eee;
  340. p {
  341. margin-bottom: 1rem;
  342. color: #666;
  343. font-size: 0.9rem;
  344. }
  345. .social-icons {
  346. display: flex;
  347. justify-content: center;
  348. gap: 1rem;
  349. .social-btn {
  350. width: 45px;
  351. height: 45px;
  352. border-radius: 50%;
  353. display: flex;
  354. align-items: center;
  355. justify-content: center;
  356. font-size: 1.2rem;
  357. color: white;
  358. border: none;
  359. cursor: pointer;
  360. transition: transform 0.3s;
  361. &:hover {
  362. transform: translateY(-3px);
  363. }
  364. &.wechat {
  365. background: #09bb07;
  366. }
  367. &.qq {
  368. background: #12b7f5;
  369. }
  370. &.weibo {
  371. background: #e6162d;
  372. }
  373. }
  374. }
  375. }
  376. }
  377. }
  378. /* 响应式调整 */
  379. @media (max-width: 768px) {
  380. .user-section {
  381. .btn {
  382. padding: 0.4rem 0.8rem;
  383. font-size: 0.9rem;
  384. }
  385. .user-profile {
  386. .username {
  387. display: none;
  388. }
  389. }
  390. }
  391. .auth-modal {
  392. width: 90%;
  393. }
  394. }